Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/eesh Modified Files: E.h comms.c main.c Log Message: Cleanups, enable compiling everything as if it were C++. =================================================================== RCS file: /cvs/e/e16/e/eesh/E.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -3 -r1.24 -r1.25 --- E.h 13 Jan 2007 19:14:26 -0000 1.24 +++ E.h 17 Jan 2007 01:10:40 -0000 1.25 @@ -38,12 +38,11 @@ #define USE_LIBC_STRDUP 1 /* Use libc strdup if present */ #endif -typedef struct _client +typedef struct { Window win; char *msg; -} -Client; +} Client; Window CommsSetup(void); Window CommsFindCommsWindow(void); @@ -55,9 +54,12 @@ void Alert(const char *fmt, ...); #define Ecalloc calloc -#define Emalloc malloc #define Efree free +#define Emalloc malloc #define Erealloc realloc + +#define EMALLOC(type, num) (type*)Emalloc((num)*sizeof(type)) +#define EREALLOC(type, ptr, num) (type*)Erealloc(ptr, (num)*sizeof(type)) #if USE_LIBC_STRDUP #define Estrdup(s) ((s) ? strdup(s) : NULL) =================================================================== RCS file: /cvs/e/e16/e/eesh/comms.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- comms.c 13 Jan 2007 19:14:26 -0000 1.16 +++ comms.c 17 Jan 2007 01:10:40 -0000 1.17 @@ -150,7 +150,8 @@ if (c->msg) { /* append text to end of msg */ - c->msg = Erealloc(c->msg, strlen(c->msg) + strlen(s) + 1); + c->msg = EREALLOC(char, c->msg, strlen(c->msg) + strlen(s) + 1); + if (!c->msg) return NULL; strcat(c->msg, s); @@ -158,7 +159,8 @@ else { /* new msg */ - c->msg = Emalloc(strlen(s) + 1); + c->msg = EMALLOC(char, strlen(s) + 1); + if (!c->msg) return NULL; strcpy(c->msg, s); @@ -177,7 +179,7 @@ { Client *c; - c = Emalloc(sizeof(Client)); + c = EMALLOC(Client, 1); if (!c) return NULL; =================================================================== RCS file: /cvs/e/e16/e/eesh/main.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -3 -r1.23 -r1.24 --- main.c 13 Jan 2007 19:14:26 -0000 1.23 +++ main.c 17 Jan 2007 01:10:40 -0000 1.24 @@ -173,7 +173,8 @@ for (; i < argc; i++) { l = strlen(argv[i]); - command = Erealloc(command, len + l + 2); + command = EREALLOC(char, command, len + l + 2); + if (len) command[len++] = ' '; strcpy(command + len, argv[i]); @@ -264,7 +265,7 @@ if (!s) return NULL; sz = strlen(s); - ss = Emalloc(sz + 1); + ss = EMALLOC(char, sz + 1); strncpy(ss, s, sz + 1); return ss; ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs