Skip to content

Commit

Permalink
Use pragma once in more places (project-chip#3182)
Browse files Browse the repository at this point in the history
* Add a lot of pragma once changes. Now scripted!

* update pragma once in setup payload

* More pragma once

* Pragma once within platform and more

* pragma once in the crypto layer

* pragma once in examples

* Fix by restyle-diff
  • Loading branch information
andy31415 authored and Rob Walker committed Oct 12, 2020
1 parent 8d1673f commit b90ead3
Show file tree
Hide file tree
Showing 321 changed files with 321 additions and 1,268 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
*
*/

#ifndef __CHIPTOOL_BARRIERCONTROL_COMMANDS_H__
#define __CHIPTOOL_BARRIERCONTROL_COMMANDS_H__
#pragma once

#include "../../common/ModelCommand.h"

Expand Down Expand Up @@ -61,5 +60,3 @@ void registerClusterBarrierControl(Commands & commands)

commands.Register(clusterName, clusterCommands);
}

#endif // __CHIPTOOL_BARRIERCONTROL_COMMANDS_H__
5 changes: 1 addition & 4 deletions examples/chip-tool/commands/clusters/Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
//
//

#ifndef __CHIPTOOL_CLUSTERS_COMMANDS_H__
#define __CHIPTOOL_CLUSTERS_COMMANDS_H__
#pragma once

#include "../common/ModelCommand.h"

Expand Down Expand Up @@ -3677,5 +3676,3 @@ void registerClusters(Commands & commands)
registerClusterScenes(commands);
registerClusterTemperatureMeasurement(commands);
}

#endif // __CHIPTOOL_CLUSTERS_COMMANDS_H__
5 changes: 1 addition & 4 deletions examples/chip-tool/commands/clusters/DoorLock/Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
*
*/

#ifndef __CHIPTOOL_DOORLOCK_COMMANDS_H__
#define __CHIPTOOL_DOORLOCK_COMMANDS_H__
#pragma once

#include "../../common/ModelCommand.h"

Expand Down Expand Up @@ -61,5 +60,3 @@ void registerClusterDoorLock(Commands & commands)

commands.Register(clusterName, clusterCommands);
}

#endif // __CHIPTOOL_DOORLOCK_COMMANDS_H__
5 changes: 1 addition & 4 deletions examples/chip-tool/commands/common/Command.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
*
*/

#ifndef __CHIPTOOL_COMMAND_H__
#define __CHIPTOOL_COMMAND_H__
#pragma once

#include <controller/CHIPDeviceController.h>
#include <inet/InetInterface.h>
Expand Down Expand Up @@ -110,5 +109,3 @@ class Command
const char * mName = nullptr;
std::vector<Argument> mArgs;
};

#endif // __CHIPTOOL_COMMAND_H__
5 changes: 1 addition & 4 deletions examples/chip-tool/commands/common/Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
*
*/

#ifndef __CHIPTOOL_COMMANDS_H__
#define __CHIPTOOL_COMMANDS_H__
#pragma once

#include "Command.h"
#include <map>
Expand All @@ -43,5 +42,3 @@ class Commands

std::map<const char *, std::vector<std::unique_ptr<Command>>> clusters;
};

#endif // __CHIPTOOL_COMMANDS_H__
5 changes: 1 addition & 4 deletions examples/chip-tool/commands/common/EchoCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
*
*/

#ifndef __CHIPTOOL_COMMAND_ECHO_H__
#define __CHIPTOOL_COMMAND_ECHO_H__
#pragma once

#include "NetworkCommand.h"

Expand All @@ -40,5 +39,3 @@ class EchoCommand : public NetworkCommand

ChipDeviceController * mController = nullptr;
};

#endif // __CHIPTOOL_COMMAND_ECHO_H__
5 changes: 1 addition & 4 deletions examples/chip-tool/commands/common/ModelCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
*
*/

#ifndef __CHIPTOOL_MODELCOMMAND_H__
#define __CHIPTOOL_MODELCOMMAND_H__
#pragma once

#include "NetworkCommand.h"

Expand Down Expand Up @@ -76,5 +75,3 @@ class ModelCommand : public NetworkCommand
uint32_t mEndPointId;
uint16_t mClusterId;
};

#endif // __CHIPTOOL_MODELCOMMAND_H__
5 changes: 1 addition & 4 deletions examples/chip-tool/commands/common/NetworkCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
*
*/

#ifndef __CHIPTOOL_IPCOMMAND_H__
#define __CHIPTOOL_IPCOMMAND_H__
#pragma once

#include "Command.h"

Expand Down Expand Up @@ -65,5 +64,3 @@ class NetworkCommand : public Command
uint32_t mDiscriminator;
uint32_t mSetupPINCode;
};

#endif //__CHIPTOOL_IPCOMMAND_H__
5 changes: 1 addition & 4 deletions examples/chip-tool/commands/echo/Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
*
*/

#ifndef __CHIPTOOL_ECHO_COMMANDS_H__
#define __CHIPTOOL_ECHO_COMMANDS_H__
#pragma once

#include "../common/EchoCommand.h"

Expand All @@ -44,5 +43,3 @@ void registerCommandsEcho(Commands & commands)

commands.Register(clusterName, clusterCommands);
}

#endif // __CHIPTOOL_ECHO_COMMANDS_H__
5 changes: 1 addition & 4 deletions examples/common/chip-app-server/include/DataModelHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
* This file defines the API for the handler for data model messages.
*/

#ifndef DATA_MODEL_HANDLER_H
#define DATA_MODEL_HANDLER_H
#pragma once

#include <system/SystemPacketBuffer.h>
#include <transport/SecureSessionMgr.h>
Expand All @@ -39,5 +38,3 @@ void HandleDataModelMessage(const chip::PacketHeader & header, chip::System::Pac
chip::SecureSessionMgrBase * mgr);
void InitDataModelHandler();
}

#endif // DATA_MODEL_HANDLER_H
5 changes: 1 addition & 4 deletions examples/common/chip-app-server/include/QRCodeUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@
* limitations under the License.
*/

#ifndef QR_CODE_UTIL_H
#define QR_CODE_UTIL_H
#pragma once

#include <setup_payload/SetupPayload.h>

void PrintQRCode(chip::RendezvousInformationFlags rendezvousFlags);

#endif // QR_CODE_UTIL_H
5 changes: 1 addition & 4 deletions examples/common/chip-app-server/include/RendezvousServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
* limitations under the License.
*/

#ifndef CHIP_APP_SERVER_RENDEZVOUS_DELEGATE_H_
#define CHIP_APP_SERVER_RENDEZVOUS_DELEGATE_H_
#pragma once

#include <platform/CHIPDeviceLayer.h>
#include <transport/RendezvousSession.h>
Expand All @@ -40,5 +39,3 @@ class RendezvousServer : public RendezvousSessionDelegate
};

} // namespace chip

#endif // CHIP_APP_SERVER_RENDEZVOUS_DELEGATE_H_
5 changes: 1 addition & 4 deletions examples/common/chip-app-server/include/Server.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
* limitations under the License.
*/

#ifndef CHIP_APP_SERVER_SERVER_H
#define CHIP_APP_SERVER_SERVER_H
#pragma once

#include <inet/IPAddress.h>
#include <inet/InetLayer.h>
Expand All @@ -33,5 +32,3 @@ using DemoSessionManager = chip::SecureSessionMgr<chip::Transport::UDP>;
* @param [in] sessions The demo's session manager.
*/
void InitServer();

#endif // CHIP_APP_SERVER_SERVER_H
5 changes: 1 addition & 4 deletions examples/common/screen-framework/include/Display.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
*
*/

#ifndef DISPLAY_H
#define DISPLAY_H
#pragma once

#include "esp_system.h"

Expand Down Expand Up @@ -98,5 +97,3 @@ extern void DisplayStatusMessage(char * msg, uint16_t vpos);
extern bool WakeDisplay();

#endif // #if CONFIG_HAVE_DISPLAY

#endif // DISPLAY_H
5 changes: 1 addition & 4 deletions examples/common/screen-framework/include/ListScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
*
*/

#ifndef LIST_SCREEN_H
#define LIST_SCREEN_H
#pragma once

#include "Screen.h"
#include "ScreenManager.h"
Expand Down Expand Up @@ -124,5 +123,3 @@ class SimpleListModel : public ListScreen::Model
};

#endif // CONFIG_HAVE_DISPLAY

#endif // LIST_SCREEN_H
5 changes: 1 addition & 4 deletions examples/common/screen-framework/include/Screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
*
*/

#ifndef SCREEN_H
#define SCREEN_H
#pragma once

#include "Display.h"

Expand Down Expand Up @@ -66,5 +65,3 @@ class Screen
};

#endif // CONFIG_HAVE_DISPLAY

#endif // SCREEN_H
5 changes: 1 addition & 4 deletions examples/common/screen-framework/include/ScreenManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
*
*/

#ifndef SCREEN_MANAGER_H
#define SCREEN_MANAGER_H
#pragma once

#include "Display.h"
#include "Screen.h"
Expand Down Expand Up @@ -63,5 +62,3 @@ class ScreenManager
};

#endif // CONFIG_HAVE_DISPLAY

#endif // SCREEN_MANAGER_H
4 changes: 1 addition & 3 deletions examples/lighting-app/efr32/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
* limitations under the License.
*/

#ifndef APP_CONFIG_H
#define APP_CONFIG_H
#pragma once

// ---- Lighting Example App Config ----

Expand Down Expand Up @@ -67,4 +66,3 @@ void appError(int err);
#ifdef __cplusplus
}
#endif
#endif // APP_CONFIG_H
5 changes: 1 addition & 4 deletions examples/lighting-app/efr32/include/AppEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
* limitations under the License.
*/

#ifndef APP_EVENT_H
#define APP_EVENT_H
#pragma once

struct AppEvent;
typedef void (*EventHandler)(AppEvent *);
Expand Down Expand Up @@ -55,5 +54,3 @@ struct AppEvent

EventHandler Handler;
};

#endif // APP_EVENT_H
5 changes: 1 addition & 4 deletions examples/lighting-app/efr32/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
* limitations under the License.
*/

#ifndef APP_TASK_H
#define APP_TASK_H
#pragma once

#include <stdbool.h>
#include <stdint.h>
Expand Down Expand Up @@ -85,5 +84,3 @@ inline AppTask & GetAppTask(void)
{
return AppTask::sAppTask;
}

#endif // APP_TASK_H
5 changes: 1 addition & 4 deletions examples/lighting-app/efr32/include/ButtonHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
* limitations under the License.
*/

#ifndef BUTTON_HANDLER_H
#define BUTTON_HANDLER_H
#pragma once

#include <stdint.h>

Expand All @@ -36,5 +35,3 @@ class ButtonHandler
static void EventHelper(uint8_t btnIdx, bool isrContext);
static void TimerCallback(TimerHandle_t xTimer);
};

#endif // BUTTON_HANDLER_H
5 changes: 1 addition & 4 deletions examples/lighting-app/efr32/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
*
*/

#ifndef CHIP_PROJECT_CONFIG_H
#define CHIP_PROJECT_CONFIG_H
#pragma once

/**
* CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY
Expand Down Expand Up @@ -122,5 +121,3 @@
* A size, in bytes, of the individual debug event logging buffer.
*/
#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (512)

#endif // CHIP_PROJECT_CONFIG_H
4 changes: 1 addition & 3 deletions examples/lighting-app/efr32/include/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@
1 tab == 4 spaces!
*/

#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
#pragma once

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -284,4 +283,3 @@ standard names. */
#ifdef __cplusplus
}
#endif
#endif /* FREERTOS_CONFIG_H */
5 changes: 1 addition & 4 deletions examples/lighting-app/efr32/include/LightingManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
* limitations under the License.
*/

#ifndef LIGHT_MANAGER_H
#define LIGHT_MANAGER_H
#pragma once

#include <stdbool.h>
#include <stdint.h>
Expand Down Expand Up @@ -82,5 +81,3 @@ inline LightingManager & LightMgr(void)
{
return LightingManager::sLight;
}

#endif // LIGHT_MANAGER_H
5 changes: 1 addition & 4 deletions examples/lighting-app/efr32/include/board_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
*
******************************************************************************/

#ifndef BOARD_FEATURES_H
#define BOARD_FEATURES_H
#pragma once

// Top level macros
#define SILABS_AF_DEVICE_NAME "lighting-example"
Expand Down Expand Up @@ -248,5 +247,3 @@
// #define FEATURE_EFP
// #define FEATURE_BOARD_DETECTED
#endif

#endif /* BOARD_FEATURES_H */
Loading

0 comments on commit b90ead3

Please sign in to comment.