Clean up include guards and EOF newlines (#65)

* Replaced include guards with #pragma once

* All source files now have exactly one newline appended

Some files had either two newlines at the end or none (which isn't POSIX compliant). This patch fixes that.
This commit is contained in:
Tyler Veness
2016-05-25 22:40:15 -07:00
committed by Peter Johnson
parent d82635bbe1
commit 62812faf62
57 changed files with 56 additions and 194 deletions

View File

@@ -87,4 +87,3 @@ Standard: Auto
TabWidth: 8
UseTab: Never
...

View File

@@ -2,4 +2,4 @@
host=usfirst.collab.net
port=29418
project=allwpilib
defaultbranch=master
defaultbranch=master

View File

@@ -53,4 +53,4 @@ When you first submit changes, Travis-CI will attempt to run `./gradlew check` o
## Licensing
By contributing to WPILib, you agree that your code will be distributed with WPILib, and licensed under the license for the WPILib project. You should not contribute code that you do not have permission to relicense in this manner. This includes code that is licensed under the GPL that you do not have permission to relicense, as WPILib is not released under a copyleft license. Our license is the 3-clause BSD license, which you can find [here](license.txt).
By contributing to WPILib, you agree that your code will be distributed with WPILib, and licensed under the license for the WPILib project. You should not contribute code that you do not have permission to relicense in this manner. This includes code that is licensed under the GPL that you do not have permission to relicense, as WPILib is not released under a copyleft license. Our license is the 3-clause BSD license, which you can find [here](license.txt).

View File

@@ -89,4 +89,4 @@ The styleguide directory contains the styleguide for C++ and Java code. Anything
# Contributing to WPILib
See [CONTRIBUTING.md](CONTRIBUTING.md).
See [CONTRIBUTING.md](CONTRIBUTING.md).

View File

@@ -7,8 +7,7 @@
#include <stdint.h>
#ifndef __HAL_COMPRESSOR_H__
#define __HAL_COMPRESSOR_H__
#pragma once
extern "C" {
void* initializeCompressor(uint8_t module);
@@ -30,5 +29,3 @@ bool getCompressorNotConnectedStickyFault(void* pcm_pointer, int32_t* status);
bool getCompressorNotConnectedFault(void* pcm_pointer, int32_t* status);
void clearAllPCMStickyFaults(void* pcm_pointer, int32_t* status);
}
#endif

View File

@@ -15,4 +15,4 @@ publishing {
dependencies {
compile 'com.google.protobuf:protobuf-java:2.5.0'
}
}

View File

@@ -144,4 +144,3 @@ hr {
.revision {
text-align: right;
}

View File

@@ -921,4 +921,3 @@ xmlns:fn="http://www.w3.org/2005/xpath-functions">
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View File

@@ -1,4 +1,4 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
*.sh text eol=lf
*.sh text eol=lf

View File

@@ -378,4 +378,4 @@ td:not(.linenos) .linenodiv { padding: 0 !important; }
<p>These test scripts are designed to allow the user of the WPILib test framework to quickly and easily deploy and run their tests on the WPI roboRIO.</p>
<p>In order for the automated test system to work there is a driver station onboard the roboRIO that handles a queue of users waiting to use the driver station. All of the interaction with this queue is handled internally by test scripts contained within this file.</p>
<h2 id="running-tests"><a name="user-content-running-tests" href="#running-tests" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>Running Tests</h2>
<p>See screen steps live: [TODO: Add link to screen steps live]</p></body></html>
<p>See screen steps live: [TODO: Add link to screen steps live]</p></body></html>

View File

@@ -36,6 +36,3 @@ DEFAULT_LOCAL_JAVA_TEST_FILE=../wpilibjIntegrationTests/build/libs/wpilibjIntegr
JAVA_REPORT=javareport.xml
DEFAULT_LOCAL_JAVA_TEST_RESULT=${DEFAULT_LOCAL_TEST_RESULTS_DIR}/${JAVA_REPORT}
DEFAULT_DESTINATION_JAVA_TEST_RESULTS=${DEFAULT_DESTINATION_TEST_RESULTS_DIR}/AntReports/TEST-edu.wpi.first.wpilibj.test.TestSuite.xml

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef Compressor_H_
#define Compressor_H_
#pragma once
#include <memory>
@@ -61,5 +60,3 @@ class Compressor : public SensorBase,
std::shared_ptr<ITable> m_table;
};
#endif /* Compressor_H_ */

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __CONTROLLER_POWER_H__
#define __CONTROLLER_POWER_H__
#pragma once
class ControllerPower {
public:
@@ -25,4 +24,3 @@ class ControllerPower {
static bool GetEnabled6V();
static int GetFaultCount6V();
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef JOYSTICK_H_
#define JOYSTICK_H_
#pragma once
#include <stdint.h>
@@ -115,5 +114,3 @@ class Joystick : public GenericHID, public ErrorBase {
uint16_t m_leftRumble = 0;
uint16_t m_rightRumble = 0;
};
#endif

View File

@@ -6,8 +6,6 @@
/*----------------------------------------------------------------------------*/
#pragma once
#ifndef __WPILIB_POWER_DISTRIBUTION_PANEL_H__
#define __WPILIB_POWER_DISTRIBUTION_PANEL_H__
#include <memory>
@@ -44,5 +42,3 @@ class PowerDistributionPanel : public SensorBase, public LiveWindowSendable {
std::shared_ptr<ITable> m_table;
uint8_t m_module;
};
#endif /* __WPILIB_POWER_DISTRIBUTION_PANEL_H__ */

View File

@@ -26,4 +26,3 @@ apply from: 'athena.gradle'
if (hasProperty('makeSim')){
apply from: 'simulation.gradle'
}

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __BUTTON_H__
#define __BUTTON_H__
#pragma once
#include "Buttons/Trigger.h"
#include "Commands/Command.h"
@@ -33,5 +32,3 @@ class Button : public Trigger {
virtual void CancelWhenPressed(Command* command);
virtual void ToggleWhenPressed(Command* command);
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __BUTTON_SCHEDULER_H__
#define __BUTTON_SCHEDULER_H__
#pragma once
class Trigger;
class Command;
@@ -23,5 +22,3 @@ class ButtonScheduler {
Trigger* m_button;
Command* m_command;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __CANCEL_BUTTON_SCHEDULER_H__
#define __CANCEL_BUTTON_SCHEDULER_H__
#pragma once
#include "Buttons/ButtonScheduler.h"
@@ -22,5 +21,3 @@ class CancelButtonScheduler : public ButtonScheduler {
private:
bool pressedLast;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __HELD_BUTTON_SCHEDULER_H__
#define __HELD_BUTTON_SCHEDULER_H__
#pragma once
#include "Buttons/ButtonScheduler.h"
@@ -19,5 +18,3 @@ class HeldButtonScheduler : public ButtonScheduler {
virtual ~HeldButtonScheduler() = default;
virtual void Execute();
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __INTERNAL_BUTTON_H__
#define __INTERNAL_BUTTON_H__
#pragma once
#include "Buttons/Button.h"
@@ -25,5 +24,3 @@ class InternalButton : public Button {
bool m_pressed = false;
bool m_inverted = false;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __JOYSTICK_BUTTON_H__
#define __JOYSTICK_BUTTON_H__
#pragma once
#include "Buttons/Button.h"
#include "GenericHID.h"
@@ -22,5 +21,3 @@ class JoystickButton : public Button {
GenericHID* m_joystick;
int m_buttonNumber;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __NETWORK_BUTTON_H__
#define __NETWORK_BUTTON_H__
#pragma once
#include <memory>
#include <string>
@@ -24,5 +23,3 @@ class NetworkButton : public Button {
std::shared_ptr<ITable> m_netTable;
std::string m_field;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __PRESSED_BUTTON_SCHEDULER_H__
#define __PRESSED_BUTTON_SCHEDULER_H__
#pragma once
#include "Buttons/ButtonScheduler.h"
@@ -19,5 +18,3 @@ class PressedButtonScheduler : public ButtonScheduler {
virtual ~PressedButtonScheduler() = default;
virtual void Execute();
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __RELEASED_BUTTON_SCHEDULER_H__
#define __RELEASED_BUTTON_SCHEDULER_H__
#pragma once
#include "Buttons/ButtonScheduler.h"
@@ -19,5 +18,3 @@ class ReleasedButtonScheduler : public ButtonScheduler {
virtual ~ReleasedButtonScheduler() = default;
virtual void Execute();
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __TOGGLE_BUTTON_SCHEDULER_H__
#define __TOGGLE_BUTTON_SCHEDULER_H__
#pragma once
#include "Buttons/ButtonScheduler.h"
@@ -22,5 +21,3 @@ class ToggleButtonScheduler : public ButtonScheduler {
private:
bool pressedLast;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __TRIGGER_H__
#define __TRIGGER_H__
#pragma once
#include <memory>
#include "SmartDashboard/Sendable.h"
@@ -49,5 +48,3 @@ class Trigger : public Sendable {
protected:
std::shared_ptr<ITable> m_table;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __COMMAND_H__
#define __COMMAND_H__
#pragma once
#include <memory>
#include <set>
@@ -178,5 +177,3 @@ class Command : public ErrorBase, public NamedSendable, public ITableListener {
protected:
std::shared_ptr<ITable> m_table;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __COMMAND_GROUP_H__
#define __COMMAND_GROUP_H__
#pragma once
#include <list>
#include <vector>
@@ -69,5 +68,3 @@ class CommandGroup : public Command {
/** The current command, -1 signifies that none have been run */
int m_currentCommandIndex = -1;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __COMMAND_GROUP_ENTRY_H__
#define __COMMAND_GROUP_ENTRY_H__
#pragma once
class Command;
@@ -26,5 +25,3 @@ class CommandGroupEntry {
Command* m_command = nullptr;
Sequence m_state = kSequence_InSequence;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __PID_COMMAND_H__
#define __PID_COMMAND_H__
#pragma once
#include "Commands/Command.h"
#include "PIDController.h"
@@ -55,5 +54,3 @@ class PIDCommand : public Command, public PIDOutput, public PIDSource {
virtual void InitTable(std::shared_ptr<ITable> table);
virtual std::string GetSmartDashboardType() const;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __PID_SUBSYSTEM_H__
#define __PID_SUBSYSTEM_H__
#pragma once
#include "Commands/Subsystem.h"
#include "PIDController.h"
@@ -70,5 +69,3 @@ class PIDSubsystem : public Subsystem, public PIDOutput, public PIDSource {
virtual void InitTable(std::shared_ptr<ITable> table);
virtual std::string GetSmartDashboardType() const;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __PRINT_COMMAND_H__
#define __PRINT_COMMAND_H__
#pragma once
#include <string>
#include "Commands/Command.h"
@@ -26,5 +25,3 @@ class PrintCommand : public Command {
private:
std::string m_message;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __SCHEDULER_H__
#define __SCHEDULER_H__
#pragma once
#include <list>
#include <map>
@@ -67,4 +66,3 @@ class Scheduler : public ErrorBase, public NamedSendable {
std::shared_ptr<ITable> m_table;
bool m_runningCommandsChanged = false;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __START_COMMAND_H__
#define __START_COMMAND_H__
#pragma once
#include "Commands/Command.h"
@@ -25,5 +24,3 @@ class StartCommand : public Command {
private:
Command* m_commandToFork;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __SUBSYSTEM_H__
#define __SUBSYSTEM_H__
#pragma once
#include <memory>
#include <string>
@@ -46,5 +45,3 @@ class Subsystem : public ErrorBase, public NamedSendable {
protected:
std::shared_ptr<ITable> m_table;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __WAIT_COMMAND_H__
#define __WAIT_COMMAND_H__
#pragma once
#include "Commands/Command.h"
@@ -23,5 +22,3 @@ class WaitCommand : public Command {
virtual void End();
virtual void Interrupted();
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __WAIT_FOR_CHILDREN_H__
#define __WAIT_FOR_CHILDREN_H__
#pragma once
#include "Commands/Command.h"
@@ -23,5 +22,3 @@ class WaitForChildren : public Command {
virtual void End();
virtual void Interrupted();
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __WAIT_UNTIL_COMMAND_H__
#define __WAIT_UNTIL_COMMAND_H__
#pragma once
#include "Commands/Command.h"
@@ -26,5 +25,3 @@ class WaitUntilCommand : public Command {
private:
double m_time;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef _LIVE_WINDOW_H
#define _LIVE_WINDOW_H
#pragma once
#include <map>
#include <memory>
@@ -82,5 +81,3 @@ class LiveWindow {
bool m_enabled = false;
bool m_firstTime = true;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef LIVEWINDOWSENDABLE_H_
#define LIVEWINDOWSENDABLE_H_
#pragma once
#include "SmartDashboard/Sendable.h"
@@ -35,5 +34,3 @@ class LiveWindowSendable : public Sendable {
*/
virtual void StopLiveWindowMode() = 0;
};
#endif /* LIVEWINDOWSENDABLE_H_ */

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef _LIVE_WINDOW_STATUS_LISTENER_H
#define _LIVE_WINDOW_STATUS_LISTENER_H
#pragma once
#include "tables/ITable.h"
#include "tables/ITableListener.h"
@@ -16,5 +15,3 @@ class LiveWindowStatusListener : public ITableListener {
virtual void ValueChanged(ITable* source, llvm::StringRef key,
std::shared_ptr<nt::Value> value, bool isNew);
};
#endif

View File

@@ -1,12 +1,11 @@
/*
* NamedSendable.h
*
* Created on: Oct 19, 2012
* Author: Mitchell Wills
*/
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2012-2016. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef NAMEDSENDABLE_H_
#define NAMEDSENDABLE_H_
#pragma once
#include <string>
#include "SmartDashboard/Sendable.h"
@@ -24,5 +23,3 @@ class NamedSendable : public Sendable {
*/
virtual std::string GetName() const = 0;
};
#endif /* NAMEDSENDABLE_H_ */

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __SMART_DASHBOARD_DATA__
#define __SMART_DASHBOARD_DATA__
#pragma once
#include <memory>
#include <string>
@@ -31,5 +30,3 @@ class Sendable {
*/
virtual std::string GetSmartDashboardType() const = 0;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __SENDABLE_CHOOSER_H__
#define __SENDABLE_CHOOSER_H__
#pragma once
#include <map>
#include <memory>
@@ -44,5 +43,3 @@ class SendableChooser : public Sendable {
std::map<std::string, void*> m_choices;
std::shared_ptr<ITable> m_table;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef __SMART_DASHBOARD_H__
#define __SMART_DASHBOARD_H__
#pragma once
#include <map>
#include <string>
@@ -49,5 +48,3 @@ class SmartDashboard : public SensorBase {
*/
static std::map<std::shared_ptr<ITable>, Sendable*> m_tablesToData;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef INTERFACES_POTENTIOMETER_H
#define INTERFACES_POTENTIOMETER_H
#pragma once
#include "PIDSource.h"
@@ -26,5 +25,3 @@ class Potentiometer : public PIDSource {
virtual void SetPIDSourceType(PIDSourceType pidSource) override;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef JOYSTICK_H_
#define JOYSTICK_H_
#pragma once
#include <memory>
#include "ErrorBase.h"
@@ -77,5 +76,3 @@ class Joystick : public GenericHID, public ErrorBase {
std::unique_ptr<uint32_t[]> m_axes;
std::unique_ptr<uint32_t[]> m_buttons;
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef _SIM_MAIN_NODE_H
#define _SIM_MAIN_NODE_H
#pragma once
#include <gazebo/gazebo_client.hh>
#include <gazebo/transport/transport.hh>
@@ -59,5 +58,3 @@ class MainNode {
}
}
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef _SIM_SPEED_CONTROLLER_H
#define _SIM_SPEED_CONTROLLER_H
#pragma once
#ifdef _WIN32
// Ensure that Winsock2.h is included before Windows.h, which can get
@@ -42,5 +41,3 @@ class SimContinuousOutput {
*/
float Get();
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef _SIM_DIGITAL_INPUT_H
#define _SIM_DIGITAL_INPUT_H
#pragma once
#include <gazebo/transport/transport.hh>
#include "simulation/gz_msgs/msgs.h"
@@ -27,5 +26,3 @@ class SimDigitalInput {
transport::SubscriberPtr sub;
void callback(const msgs::ConstBoolPtr& msg);
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef _SIM_ENCODER_H
#define _SIM_ENCODER_H
#pragma once
#include <gazebo/common/Time.hh>
#include <gazebo/transport/transport.hh>
@@ -33,5 +32,3 @@ class SimEncoder {
void positionCallback(const msgs::ConstFloat64Ptr& msg);
void velocityCallback(const msgs::ConstFloat64Ptr& msg);
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef _SIM_FLOAT_INPUT_H
#define _SIM_FLOAT_INPUT_H
#pragma once
#include <gazebo/transport/transport.hh>
#include "simulation/gz_msgs/msgs.h"
@@ -27,5 +26,3 @@ class SimFloatInput {
transport::SubscriberPtr sub;
void callback(const msgs::ConstFloat64Ptr& msg);
};
#endif

View File

@@ -5,8 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef _SIM_GYRO_H
#define _SIM_GYRO_H
#pragma once
#include <gazebo/transport/transport.hh>
#include "simulation/gz_msgs/msgs.h"
@@ -30,5 +29,3 @@ class SimGyro {
void positionCallback(const msgs::ConstFloat64Ptr& msg);
void velocityCallback(const msgs::ConstFloat64Ptr& msg);
};
#endif

View File

@@ -1,2 +1,2 @@
*~
target/
target/

View File

@@ -2,4 +2,4 @@
killall java
killall FRCUserProgram
sleep 1
/usr/local/frc/JRE/bin/java -ea -jar wpilibJavaIntegrationTests-0.1.0-SNAPSHOT.jar $@
/usr/local/frc/JRE/bin/java -ea -jar wpilibJavaIntegrationTests-0.1.0-SNAPSHOT.jar $@

View File

@@ -23,6 +23,3 @@ java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
############################################################
edu.wpi.first.wpilibj.level=INFO
edu.wpi.first.wpilibj.command.level=INFO