Skip to content

Commit

Permalink
libdeng2: Updated code style convention
Browse files Browse the repository at this point in the history
Updated libdeng2 with the revised code style conventions.
  • Loading branch information
skyjake committed Nov 24, 2012
1 parent 402a0ce commit a77173c
Show file tree
Hide file tree
Showing 198 changed files with 2,287 additions and 2,287 deletions.
54 changes: 27 additions & 27 deletions doomsday/libdeng2/include/de/c_wrapper.h
Expand Up @@ -66,9 +66,9 @@ typedef enum legacycore_loglevel_e {
DE2_LOG_CRITICAL
} legacycore_loglevel_t;

DENG2_PUBLIC LegacyCore* LegacyCore_New(void* dengApp);
DENG2_PUBLIC void LegacyCore_Delete(LegacyCore* lc);
DENG2_PUBLIC LegacyCore* LegacyCore_Instance();
DENG2_PUBLIC LegacyCore *LegacyCore_New(void *dengApp);
DENG2_PUBLIC void LegacyCore_Delete(LegacyCore *lc);
DENG2_PUBLIC LegacyCore *LegacyCore_Instance();
DENG2_PUBLIC void LegacyCore_SetLoopRate(int freqHz);
DENG2_PUBLIC void LegacyCore_SetLoopFunc(void (*callback)(void));
DENG2_PUBLIC void LegacyCore_PushLoop();
Expand All @@ -78,27 +78,27 @@ DENG2_PUBLIC void LegacyCore_ResumeLoop();
DENG2_PUBLIC int LegacyCore_RunEventLoop();
DENG2_PUBLIC void LegacyCore_Stop(int exitCode);
DENG2_PUBLIC void LegacyCore_Timer(unsigned int milliseconds, void (*callback)(void));
DENG2_PUBLIC int LegacyCore_SetLogFile(const char* filePath);
DENG2_PUBLIC const char* LegacyCore_LogFile();
DENG2_PUBLIC void LegacyCore_PrintLogFragment(const char* text);
DENG2_PUBLIC void LegacyCore_PrintfLogFragmentAtLevel(legacycore_loglevel_t level, const char* format, ...);
DENG2_PUBLIC void LegacyCore_SetTerminateFunc(void (*func)(const char*));
DENG2_PUBLIC void LegacyCore_FatalError(const char* msg);
DENG2_PUBLIC int LegacyCore_SetLogFile(char const *filePath);
DENG2_PUBLIC char const *LegacyCore_LogFile();
DENG2_PUBLIC void LegacyCore_PrintLogFragment(char const *text);
DENG2_PUBLIC void LegacyCore_PrintfLogFragmentAtLevel(legacycore_loglevel_t level, char const *format, ...);
DENG2_PUBLIC void LegacyCore_SetTerminateFunc(void (*func)(char const *));
DENG2_PUBLIC void LegacyCore_FatalError(char const *msg);

/*
* CommandLine
*/
DENG2_PUBLIC void CommandLine_Alias(const char* longname, const char* shortname);
DENG2_PUBLIC void CommandLine_Alias(char const *longname, char const *shortname);
DENG2_PUBLIC int CommandLine_Count(void);
DENG2_PUBLIC const char* CommandLine_At(int i);
DENG2_PUBLIC const char* CommandLine_PathAt(int i);
DENG2_PUBLIC const char* CommandLine_Next(void);
DENG2_PUBLIC const char* CommandLine_NextAsPath(void);
DENG2_PUBLIC int CommandLine_Check(const char* check);
DENG2_PUBLIC int CommandLine_CheckWith(const char* check, int num);
DENG2_PUBLIC int CommandLine_Exists(const char* check);
DENG2_PUBLIC char const *CommandLine_At(int i);
DENG2_PUBLIC char const *CommandLine_PathAt(int i);
DENG2_PUBLIC char const *CommandLine_Next(void);
DENG2_PUBLIC char const *CommandLine_NextAsPath(void);
DENG2_PUBLIC int CommandLine_Check(char const *check);
DENG2_PUBLIC int CommandLine_CheckWith(char const *check, int num);
DENG2_PUBLIC int CommandLine_Exists(char const *check);
DENG2_PUBLIC int CommandLine_IsOption(int i);
DENG2_PUBLIC int CommandLine_IsMatchingAlias(const char* original, const char* originalOrAlias);
DENG2_PUBLIC int CommandLine_IsMatchingAlias(char const *original, char const *originalOrAlias);

/*
* LogBuffer
Expand All @@ -114,14 +114,14 @@ DENG2_OPAQUE(LegacyNetwork)

DENG2_PUBLIC int LegacyNetwork_OpenServerSocket(unsigned short port);
DENG2_PUBLIC int LegacyNetwork_Accept(int serverSocket);
DENG2_PUBLIC int LegacyNetwork_Open(const char* ipAddress, unsigned short port);
DENG2_PUBLIC void LegacyNetwork_GetPeerAddress(int socket, char* host, int hostMaxSize, unsigned short* port);
DENG2_PUBLIC int LegacyNetwork_Open(char const *ipAddress, unsigned short port);
DENG2_PUBLIC void LegacyNetwork_GetPeerAddress(int socket, char *host, int hostMaxSize, unsigned short *port);
DENG2_PUBLIC int LegacyNetwork_IsDisconnected(int socket);
DENG2_PUBLIC void LegacyNetwork_Close(int socket);

DENG2_PUBLIC int LegacyNetwork_Send(int socket, const void *data, int size);
DENG2_PUBLIC unsigned char* LegacyNetwork_Receive(int socket, int* size);
DENG2_PUBLIC void LegacyNetwork_FreeBuffer(unsigned char* buffer);
DENG2_PUBLIC unsigned char *LegacyNetwork_Receive(int socket, int *size);
DENG2_PUBLIC void LegacyNetwork_FreeBuffer(unsigned char *buffer);
DENG2_PUBLIC int LegacyNetwork_BytesReady(int socket);

DENG2_PUBLIC int LegacyNetwork_NewSocketSet();
Expand All @@ -135,15 +135,15 @@ DENG2_PUBLIC int LegacyNetwork_SocketSet_Activity(int set);
*/
DENG2_OPAQUE(Info)

DENG2_PUBLIC Info* Info_NewFromString(const char* utf8text);
DENG2_PUBLIC Info* Info_NewFromFile(const char* nativePath);
DENG2_PUBLIC void Info_Delete(Info* info);
DENG2_PUBLIC int Info_FindValue(Info* info, const char* path, char* buffer, size_t bufSize);
DENG2_PUBLIC Info *Info_NewFromString(char const *utf8text);
DENG2_PUBLIC Info *Info_NewFromFile(char const *nativePath);
DENG2_PUBLIC void Info_Delete(Info *info);
DENG2_PUBLIC int Info_FindValue(Info *info, char const *path, char *buffer, size_t bufSize);

/*
* UnixInfo
*/
DENG2_PUBLIC int UnixInfo_GetConfigValue(const char* configFile, const char* key, char* dest, size_t destLen);
DENG2_PUBLIC int UnixInfo_GetConfigValue(char const *configFile, char const *key, char *dest, size_t destLen);

/*
* ByteOrder
Expand Down
28 changes: 14 additions & 14 deletions doomsday/libdeng2/include/de/core/app.h
Expand Up @@ -33,7 +33,7 @@
/**
* Macro for conveniently accessing the de::App singleton instance.
*/
#define DENG2_APP (static_cast<de::App*>(qApp))
#define DENG2_APP (static_cast<de::App *>(qApp))

namespace de
{
Expand Down Expand Up @@ -61,7 +61,7 @@ namespace de
Q_DECLARE_FLAGS(SubsystemInitFlags, SubsystemInitFlag)

public:
App(int& argc, char** argv, GUIMode guiMode);
App(int &argc, char** argv, GUIMode guiMode);

~App();

Expand All @@ -74,14 +74,14 @@ namespace de
*/
void initSubsystems(SubsystemInitFlags flags = DefaultSubsystems);

bool notify(QObject* receiver, QEvent* event);
bool notify(QObject *receiver, QEvent *event);

static App& app();
static App &app();

/**
* Returns the command line used to start the application.
*/
static CommandLine& commandLine();
static CommandLine &commandLine();

/**
* Returns the absolute native path of the application executable.
Expand Down Expand Up @@ -119,32 +119,32 @@ namespace de
* @return @c true, if the current working directory was changed,
* otherwise @c false.
*/
static bool setCurrentWorkPath(const NativePath& cwd);
static bool setCurrentWorkPath(NativePath const &cwd);

/**
* Returns the application's file system.
*/
static FS& fileSystem();
static FS &fileSystem();

/**
* Returns the root folder of the file system.
*/
static Folder& rootFolder();
static Folder &rootFolder();

/**
* Returns the /home folder.
*/
static Folder& homeFolder();
static Folder &homeFolder();

/**
* Returns the configuration.
*/
static Config& config();
static Config &config();

/**
* Returns the Unix system-level configuration preferences.
*/
static UnixInfo& unixInfo();
static UnixInfo &unixInfo();

/**
* Imports a script module that is located on the import path.
Expand All @@ -154,7 +154,7 @@ namespace de
*
* @return The imported module.
*/
static Record& importModule(const String& name, const String& fromPath = "");
static Record &importModule(String const &name, String const &fromPath = "");

/**
* Emits the displayModeChanged() signal.
Expand Down Expand Up @@ -185,10 +185,10 @@ namespace de
UnixInfo _unixInfo;

/// The configuration.
Config* _config;
Config *_config;

/// Resident modules.
typedef std::map<String, Module*> Modules;
typedef std::map<String, Module *> Modules;
Modules _modules;
};

Expand Down
28 changes: 14 additions & 14 deletions doomsday/libdeng2/include/de/core/commandline.h
Expand Up @@ -57,9 +57,9 @@ namespace de
*
* @param args Arguments to use.
*/
CommandLine(const QStringList& args);
CommandLine(QStringList const &args);

CommandLine(const CommandLine& other);
CommandLine(CommandLine const &other);

virtual ~CommandLine();

Expand All @@ -82,15 +82,15 @@ namespace de
*
* @param arg Argument to append.
*/
void append(const String& arg);
void append(String const &arg);

/**
* Inserts a new argument to the list of arguments at index @a pos.
*
* @param pos Index at which the new argument will be at.
* @param arg Argument to insert.
*/
void insert(duint pos, const String& arg);
void insert(duint pos, String const &arg);

/**
* Removes an argument by index.
Expand All @@ -111,7 +111,7 @@ namespace de
*
* @return Index of the argument, if found. Otherwise zero.
*/
dint check(const String& arg, dint count = 0) const;
dint check(String const &arg, dint count = 0) const;

/**
* Gets the parameter for an argument.
Expand All @@ -123,7 +123,7 @@ namespace de
* @return @c true, if parameter was successfully returned.
* Otherwise @c false, in which case @a param is not modified.
*/
bool getParameter(const String& arg, String& param) const;
bool getParameter(String const &arg, String &param) const;

/**
* Determines whether @a arg exists in the list of arguments.
Expand All @@ -132,7 +132,7 @@ namespace de
*
* @return Number of times @a arg is found in the arguments.
*/
dint has(const String& arg) const;
dint has(String const &arg) const;

/**
* Determines whether an argument is an option, i.e., it begins with a hyphen.
Expand All @@ -142,15 +142,15 @@ namespace de
/**
* Determines whether an argument is an option, i.e., it begins with a hyphen.
*/
static bool isOption(const String& arg);
static bool isOption(String const &arg);

const String at(duint pos) const;

/**
* Returns a list of pointers to the arguments. The list contains
* count() strings and is NULL-terminated.
*/
const char* const* argv() const;
char const *const *argv() const;

/**
* Converts the argument at position @a pos into an absolute native path.
Expand All @@ -166,7 +166,7 @@ namespace de
*
* @param nativePath File to parse.
*/
void parseResponseFile(const NativePath& nativePath);
void parseResponseFile(NativePath const &nativePath);

/**
* Breaks down a single string containing arguments.
Expand All @@ -179,21 +179,21 @@ namespace de
*
* @param cmdLine String containing the arguments.
*/
void parse(const String& cmdLine);
void parse(String const &cmdLine);

/**
* Defines a new alias for a full argument.
*
* @param full The full argument, e.g., "--help"
* @param alias Alias for the full argument, e.g., "-h"
*/
void alias(const String& full, const String& alias);
void alias(String const &full, String const &alias);

/**
* @return @c true, iff the two parameters are equivalent according to
* the abbreviations.
*/
bool matches(const String& full, const String& fullOrAlias) const;
bool matches(String const &full, String const &fullOrAlias) const;

/**
* Spawns a new process using the command line. The first argument
Expand All @@ -206,7 +206,7 @@ namespace de

private:
struct Instance;
Instance* d;
Instance *d;
};
}

Expand Down
14 changes: 7 additions & 7 deletions doomsday/libdeng2/include/de/core/config.h
Expand Up @@ -44,7 +44,7 @@ namespace de
*
* @param path Name of the configuration file to read.
*/
Config(const String& path);
Config(String const &path);

/**
* Destructor. The configuration is automatically saved.
Expand All @@ -58,24 +58,24 @@ namespace de
void write();

/// Returns the value of @a name as a Value.
Value& get(const String& name);
Value &get(String const &name);

/// Returns the value of @a name as an integer.
dint geti(const String& name);
dint geti(String const &name);

/// Returns the value of @a name as an unsigned integer.
duint getui(const String& name);
duint getui(String const &name);

/// Returns the value of @a name as a double-precision floating point number.
ddouble getd(const String& name);
ddouble getd(String const &name);

/// Returns the value of @a name as a string.
String gets(const String& name);
String gets(String const &name);

/**
* Returns the configuration namespace.
*/
Record& names();
Record &names();

private:
/// Configuration file name.
Expand Down

0 comments on commit a77173c

Please sign in to comment.