Skip to content

Commit

Permalink
libdeng: Updated code style convention
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Nov 24, 2012
1 parent 2725eab commit 273bada
Show file tree
Hide file tree
Showing 31 changed files with 845 additions and 845 deletions.
6 changes: 3 additions & 3 deletions doomsday/libdeng/include/de/animator.h
Expand Up @@ -40,9 +40,9 @@ typedef struct {
int steps;
} animator_t;

DENG_PUBLIC void Animator_Init(animator_t* v, float val);
DENG_PUBLIC void Animator_Set(animator_t* v, float val, int steps);
DENG_PUBLIC void Animator_Think(animator_t* v);
DENG_PUBLIC void Animator_Init(animator_t *v, float val);
DENG_PUBLIC void Animator_Set(animator_t *v, float val, int steps);
DENG_PUBLIC void Animator_Think(animator_t *v);

/**
* 2D vector animator.
Expand Down
18 changes: 9 additions & 9 deletions doomsday/libdeng/include/de/concurrency.h
Expand Up @@ -26,11 +26,11 @@

#include <de/libdeng.h>

typedef void* thread_t;
typedef int (*systhreadfunc_t) (void* parm);
typedef void *thread_t;
typedef int (*systhreadfunc_t) (void *parm);

typedef void* mutex_t;
typedef void* sem_t;
typedef void *mutex_t;
typedef void *sem_t;

typedef enum systhreadexitstatus_e {
DENG_THREAD_STOPPED_NORMALLY,
Expand All @@ -51,7 +51,7 @@ class CallbackThread : public QThread
Q_OBJECT

public:
CallbackThread(systhreadfunc_t func, void* parm = 0);
CallbackThread(systhreadfunc_t func, void *parm = 0);
~CallbackThread();

void run();
Expand All @@ -64,7 +64,7 @@ protected slots:

private:
systhreadfunc_t _callback;
void* _parm;
void *_parm;
int _returnValue;
systhreadexitstatus_t _exitStatus;
void (*_terminationFunc)(systhreadexitstatus_t);
Expand Down Expand Up @@ -93,7 +93,7 @@ extern "C" {
*
* @return Thread handle.
*/
DENG_PUBLIC thread_t Sys_StartThread(systhreadfunc_t startpos, void* parm);
DENG_PUBLIC thread_t Sys_StartThread(systhreadfunc_t startpos, void *parm);

DENG_PUBLIC void Thread_Sleep(int milliseconds);

Expand All @@ -118,7 +118,7 @@ DENG_PUBLIC void Thread_SetCallback(thread_t thread, void (*terminationFunc)(sys
*
* @return Return value of the thread.
*/
DENG_PUBLIC int Sys_WaitThread(thread_t handle, int timeoutMs, systhreadexitstatus_t* exitStatus);
DENG_PUBLIC int Sys_WaitThread(thread_t handle, int timeoutMs, systhreadexitstatus_t *exitStatus);

/**
* @param handle Handle to the thread to return the id of.
Expand All @@ -131,7 +131,7 @@ DENG_PUBLIC uint32_t Sys_CurrentThreadId(void);

DENG_PUBLIC boolean Sys_InMainThread(void);

DENG_PUBLIC mutex_t Sys_CreateMutex(const char* name);
DENG_PUBLIC mutex_t Sys_CreateMutex(char const *name);

DENG_PUBLIC void Sys_DestroyMutex(mutex_t mutexHandle);

Expand Down
12 changes: 6 additions & 6 deletions doomsday/libdeng/include/de/garbage.h
Expand Up @@ -40,12 +40,12 @@ extern "C" {
*
* @param ptr Pointer to memory. Can be allocated with malloc() or Z_Malloc().
*/
DENG_PUBLIC void Garbage_Trash(void* ptr);
DENG_PUBLIC void Garbage_Trash(void *ptr);

/**
* Pointer to an instance destructor;
*/
typedef void (*GarbageDestructor)(void*);
typedef void (*GarbageDestructor)(void *);

/**
* Puts an object up for garbage collection in the current thread. The object
Expand All @@ -54,7 +54,7 @@ typedef void (*GarbageDestructor)(void*);
* @param ptr Pointer to the object.
* @param destructor Function that destroys the object.
*/
DENG_PUBLIC void Garbage_TrashInstance(void* ptr, GarbageDestructor destructor);
DENG_PUBLIC void Garbage_TrashInstance(void *ptr, GarbageDestructor destructor);

/**
* Determines whether a memory pointer has been trashed. Only the current
Expand All @@ -64,7 +64,7 @@ DENG_PUBLIC void Garbage_TrashInstance(void* ptr, GarbageDestructor destructor);
*
* @return @c true if the pointer is in the trash.
*/
DENG_PUBLIC boolean Garbage_IsTrashed(const void* ptr);
DENG_PUBLIC boolean Garbage_IsTrashed(void const *ptr);

/**
* Removes a region from the current thread's collector, if it is still there.
Expand All @@ -73,15 +73,15 @@ DENG_PUBLIC boolean Garbage_IsTrashed(const void* ptr);
*
* @param ptr Pointer to memory allocated from the @ref memzone.
*/
DENG_PUBLIC void Garbage_Untrash(void* ptr);
DENG_PUBLIC void Garbage_Untrash(void *ptr);

/**
* Removes a pointer from the garbage. This needs to be called if the
* previously trashed memory was manually freed.
*
* @param ptr Pointer to memory.
*/
DENG_PUBLIC void Garbage_RemoveIfTrashed(void* ptr);
DENG_PUBLIC void Garbage_RemoveIfTrashed(void *ptr);

/**
* Frees all pointers given over to the current thread's garbage collector.
Expand Down
10 changes: 5 additions & 5 deletions doomsday/libdeng/include/de/memory.h
Expand Up @@ -30,15 +30,15 @@
extern "C" {
#endif

DENG_PUBLIC void* M_Malloc(size_t size);
DENG_PUBLIC void *M_Malloc(size_t size);

DENG_PUBLIC void* M_Calloc(size_t size);
DENG_PUBLIC void *M_Calloc(size_t size);

DENG_PUBLIC void* M_Realloc(void* ptr, size_t size);
DENG_PUBLIC void *M_Realloc(void *ptr, size_t size);

DENG_PUBLIC void* M_MemDup(const void* ptr, size_t size);
DENG_PUBLIC void *M_MemDup(void const *ptr, size_t size);

DENG_PUBLIC void M_Free(void* ptr);
DENG_PUBLIC void M_Free(void *ptr);

#ifdef __cplusplus
} // extern "C"
Expand Down
10 changes: 5 additions & 5 deletions doomsday/libdeng/include/de/memoryblockset.h
Expand Up @@ -58,7 +58,7 @@ typedef struct blockset_s {
size_t _blockCount;

/// Vector of blocks in the set.
struct blockset_block_s* _blocks;
struct blockset_block_s *_blocks;
} blockset_t;

/**
Expand All @@ -71,15 +71,15 @@ typedef struct blockset_s {
*
* @return Ptr to the newly created blockset.
*/
DENG_PUBLIC blockset_t* BlockSet_New(size_t sizeOfElement, size_t batchSize);
DENG_PUBLIC blockset_t *BlockSet_New(size_t sizeOfElement, size_t batchSize);

/**
* Free an entire blockset. All memory allocated is released for all elements
* in all blocks and any used for the blockset itself.
*
* @param set The blockset to be freed.
*/
DENG_PUBLIC void BlockSet_Delete(blockset_t* set);
DENG_PUBLIC void BlockSet_Delete(blockset_t *set);

/**
* Return a ptr to the next unused element in the blockset.
Expand All @@ -88,10 +88,10 @@ DENG_PUBLIC void BlockSet_Delete(blockset_t* set);
*
* @return Ptr to the next unused element in the blockset.
*/
DENG_PUBLIC void* BlockSet_Allocate(blockset_t* set);
DENG_PUBLIC void *BlockSet_Allocate(blockset_t *set);

/// @return Total number of elements from the set that are currently in use.
DENG_PUBLIC size_t BlockSet_Count(blockset_t* set);
DENG_PUBLIC size_t BlockSet_Count(blockset_t *set);

#ifdef __cplusplus
} // extern "C"
Expand Down
34 changes: 17 additions & 17 deletions doomsday/libdeng/include/de/memoryzone.h
Expand Up @@ -69,29 +69,29 @@ DENG_PUBLIC boolean Z_IsInited(void);
/**
* You can pass a NULL user if the tag is < PU_PURGELEVEL.
*/
DENG_PUBLIC void* Z_Malloc(size_t size, int tag, void* ptr);
DENG_PUBLIC void *Z_Malloc(size_t size, int tag, void *ptr);

/**
* Memory allocation utility: malloc and clear.
*/
DENG_PUBLIC void* Z_Calloc(size_t size, int tag, void* user);
DENG_PUBLIC void *Z_Calloc(size_t size, int tag, void *user);

/**
* Only resizes blocks with no user. If a block with a user is
* reallocated, the user will lose its current block and be set to
* NULL. Does not change the tag of existing blocks.
*/
DENG_PUBLIC void* Z_Realloc(void* ptr, size_t n, int mallocTag);
DENG_PUBLIC void *Z_Realloc(void *ptr, size_t n, int mallocTag);

/**
* Realloc and set possible new memory to zero.
*/
DENG_PUBLIC void* Z_Recalloc(void* ptr, size_t n, int callocTag);
DENG_PUBLIC void *Z_Recalloc(void *ptr, size_t n, int callocTag);

/**
* Free memory that was allocated with Z_Malloc.
*/
DENG_PUBLIC void Z_Free(void* ptr);
DENG_PUBLIC void Z_Free(void *ptr);

/**
* Free memory blocks in all volumes with a tag in the specified range.
Expand All @@ -106,29 +106,29 @@ DENG_PUBLIC void Z_CheckHeap(void);
/**
* Change the tag of a memory block.
*/
DENG_PUBLIC void Z_ChangeTag2(void* ptr, int tag);
DENG_PUBLIC void Z_ChangeTag2(void *ptr, int tag);

/**
* Change the user of a memory block.
*/
DENG_PUBLIC void Z_ChangeUser(void* ptr, void* newUser);
DENG_PUBLIC void Z_ChangeUser(void *ptr, void *newUser);

DENG_PUBLIC uint32_t Z_GetId(void* ptr);
DENG_PUBLIC uint32_t Z_GetId(void *ptr);

/**
* Get the user of a memory block.
*/
DENG_PUBLIC void* Z_GetUser(void* ptr);
DENG_PUBLIC void *Z_GetUser(void *ptr);

DENG_PUBLIC int Z_GetTag(void* ptr);
DENG_PUBLIC int Z_GetTag(void *ptr);

/**
* Checks if @a ptr points to memory inside the memory zone.
* @param ptr Pointer.
* @return @c true, if @a ptr points to a valid allocated memory block
* inside the zone.
*/
DENG_PUBLIC boolean Z_Contains(void* ptr);
DENG_PUBLIC boolean Z_Contains(void *ptr);

/**
* Copies @a text into a buffer allocated from the zone.
Expand All @@ -138,9 +138,9 @@ DENG_PUBLIC boolean Z_Contains(void* ptr);
*
* @return Copy of the string (in the zone).
*/
DENG_PUBLIC char* Z_StrDup(const char* text);
DENG_PUBLIC char *Z_StrDup(char const *text);

DENG_PUBLIC void* Z_MemDup(const void* ptr, size_t size);
DENG_PUBLIC void *Z_MemDup(void const *ptr, size_t size);

struct zblockset_s;
typedef struct zblockset_s zblockset_t;
Expand All @@ -154,7 +154,7 @@ typedef struct zblockset_s zblockset_t;
*
* @return Ptr to the newly created blockset.
*/
DENG_PUBLIC zblockset_t* ZBlockSet_New(size_t sizeOfElement, uint32_t batchSize, int tag);
DENG_PUBLIC zblockset_t *ZBlockSet_New(size_t sizeOfElement, uint32_t batchSize, int tag);

/**
* Destroy the entire blockset.
Expand All @@ -163,7 +163,7 @@ DENG_PUBLIC zblockset_t* ZBlockSet_New(size_t sizeOfElement, uint32_t batchSize,
*
* @param set The blockset to be freed.
*/
DENG_PUBLIC void ZBlockSet_Delete(zblockset_t* set);
DENG_PUBLIC void ZBlockSet_Delete(zblockset_t *set);

/**
* Return a ptr to the next unused element in the blockset.
Expand All @@ -172,7 +172,7 @@ DENG_PUBLIC void ZBlockSet_Delete(zblockset_t* set);
*
* @return Ptr to the next unused element in the blockset.
*/
DENG_PUBLIC void* ZBlockSet_Allocate(zblockset_t* set);
DENG_PUBLIC void *ZBlockSet_Allocate(zblockset_t *set);

#define Z_ChangeTag(p,t) { \
if(Z_GetId(p) != LIBDENG_ZONEID) \
Expand All @@ -186,7 +186,7 @@ DENG_PUBLIC void Z_PrintStatus(void);
#ifdef DENG_DEBUG
struct memzone_private_s;
typedef struct memzone_private_s MemoryZonePrivateData;
DENG_PUBLIC void Z_GetPrivateData(MemoryZonePrivateData* pd);
DENG_PUBLIC void Z_GetPrivateData(MemoryZonePrivateData *pd);
#endif

#ifdef __cplusplus
Expand Down

0 comments on commit 273bada

Please sign in to comment.