# HG changeset patch # User Matti Hamalainen # Date 1578938694 -7200 # Node ID bcd33c77c6050059cc65ee56ea5c4c3ebb885d32 # Parent 6e86a048a760f245c7928acc36b62b7e68f66542 Cosmetic cleanups. diff -r 6e86a048a760 -r bcd33c77c605 src/dmlib.h --- a/src/dmlib.h Sun Jan 12 20:53:35 2020 +0200 +++ b/src/dmlib.h Mon Jan 13 20:04:54 2020 +0200 @@ -394,11 +394,13 @@ /* Global variables */ -extern char *dmProgName, - *dmProgDesc, - *dmProgVersion, - *dmProgAuthor, - *dmProgLicense; +extern char + *dmProgName, + *dmProgDesc, + *dmProgVersion, + *dmProgAuthor, + *dmProgLicense; + extern int dmVerbosity; void dmInitProg(char *name, char *desc, char *version, char *author, char *license); @@ -420,11 +422,11 @@ const char *dmErrorStr(const int error); #ifdef DM_DEBUG -# define dmErrorDBG dmError -# define dmErrorDBGMsg dmErrorMsg +# define dmErrorDBG dmError +# define dmErrorDBGMsg dmErrorMsg #else -# define dmErrorDBG(ecode, fmt, ...) (ecode) // Dummy -# define dmErrorDBGMsg(fmt, ...) +# define dmErrorDBG(ecode, fmt, ...) (ecode) // Dummy +# define dmErrorDBGMsg(fmt, ...) #endif void * dmMalloc(size_t len); @@ -454,8 +456,6 @@ DM_TRIM_BOTH = 3 }; - - char * dm_strdup(const char *str); char * dm_strndup(const char *str, const size_t n); char * dm_strdup_trim(const char *src, const int flags); @@ -490,9 +490,9 @@ DMMutexLock locks[8]; } DMMutex; -#define dmMutexLock(x) dmDOMutexLock(x, __FILE__, (int) __LINE__) -#define dmMutexUnlock(x) dmDOMutexUnlock(x, __FILE__, (int) __LINE__) -#define dmCreateMutex(x) dmDOCreateMutex(__FILE__, (int) __LINE__) +# define dmMutexLock(x) dmDOMutexLock(x, __FILE__, (int) __LINE__) +# define dmMutexUnlock(x) dmDOMutexUnlock(x, __FILE__, (int) __LINE__) +# define dmCreateMutex(x) dmDOCreateMutex(__FILE__, (int) __LINE__) int dmDOMutexLock(DMMutex *mutex, const char *file, const int line); int dmDOMutexUnlock(DMMutex *mutex, const char *file, const int line); @@ -500,13 +500,14 @@ void dmDestroyMutex(DMMutex *mutex); #else -#define DMMutex SDL_mutex -#define dmCreateMutex() SDL_CreateMutex() -#define dmDestroyMutex(x) SDL_DestroyMutex(x) -#define dmMutexLock(x) SDL_mutexP(x) -#define dmMutexUnlock(x) SDL_mutexV(x) +# define DMMutex SDL_mutex +# define dmCreateMutex() SDL_CreateMutex() +# define dmDestroyMutex(x) SDL_DestroyMutex(x) +# define dmMutexLock(x) SDL_mutexP(x) +# define dmMutexUnlock(x) SDL_mutexV(x) #endif + /* Endianess swapping macros */ #define DM_SWAP_16_LE_BE(value) ((Uint16) ( \ diff -r 6e86a048a760 -r bcd33c77c605 src/dmtool.h --- a/src/dmtool.h Sun Jan 12 20:53:35 2020 +0200 +++ b/src/dmtool.h Mon Jan 13 20:04:54 2020 +0200 @@ -7,8 +7,11 @@ #ifndef DMTOOL_H #define DMTOOL_H 1 + // Get rid of the SDL_main mess for some commandline tools #define _SDL_main_h #define SDL_main main -#endif + +#endif // DMTOOL_H +