diff options
Diffstat (limited to 'source4/web_server/ejs')
-rw-r--r-- | source4/web_server/ejs/ejs.c | 6 | ||||
-rw-r--r-- | source4/web_server/ejs/ejs.h | 2 | ||||
-rw-r--r-- | source4/web_server/ejs/ejsInternal.h | 2 | ||||
-rw-r--r-- | source4/web_server/ejs/ejsProcs.c | 4 | ||||
-rw-r--r-- | source4/web_server/ejs/miniMpr.h | 6 | ||||
-rw-r--r-- | source4/web_server/ejs/var.c | 2 |
6 files changed, 12 insertions, 10 deletions
diff --git a/source4/web_server/ejs/ejs.c b/source4/web_server/ejs/ejs.c index 4f5eb6b129..11da79a0dd 100644 --- a/source4/web_server/ejs/ejs.c +++ b/source4/web_server/ejs/ejs.c @@ -275,7 +275,7 @@ int ejsEvalFile(EjsId eid, char *path, MprVar *result, char **emsg) if ((script = (char*) mprMalloc(sbuf.st_size + 1)) == NULL) { close(fd); - ejsError(ep, "Cant malloc %d", sbuf.st_size); + ejsError(ep, "Cant malloc %d", (int)sbuf.st_size); goto error; } @@ -468,7 +468,9 @@ int ejsEvalScript(EjsId eid, char *script, MprVar *vp, char **emsg) * Core error handling */ -void ejsErrorCore(Ejs* ep, const char *fmt, va_list args) +static void ejsErrorCore(Ejs* ep, const char *fmt, va_list args) PRINTF_ATTRIBUTE(2, 0); + +static void ejsErrorCore(Ejs* ep, const char *fmt, va_list args) { EjsInput *ip; char *errbuf, *msgbuf; diff --git a/source4/web_server/ejs/ejs.h b/source4/web_server/ejs/ejs.h index 60aa93a408..987810ad06 100644 --- a/source4/web_server/ejs/ejs.h +++ b/source4/web_server/ejs/ejs.h @@ -109,7 +109,7 @@ extern void *ejsGetThisPtr(EjsId eid); extern MprVar *ejsGetReturnValue(EjsId eid); extern int ejsGetLineNumber(EjsId eid); extern int ejsParseArgs(int argc, char **argv, char *fmt, ...); -extern void ejsSetErrorMsg(EjsId eid, const char* fmt, ...); +extern void ejsSetErrorMsg(EjsId eid, const char* fmt, ...) PRINTF_ATTRIBUTE(2,3); extern void ejsSetReturnValue(EjsId eid, MprVar value); extern void ejsSetReturnString(EjsId eid, const char *str); diff --git a/source4/web_server/ejs/ejsInternal.h b/source4/web_server/ejs/ejsInternal.h index fe79afb870..d5d5760812 100644 --- a/source4/web_server/ejs/ejsInternal.h +++ b/source4/web_server/ejs/ejsInternal.h @@ -274,7 +274,7 @@ extern int ejsDefineStandardProperties(MprVar *objVar); /* * Error handling */ -extern void ejsError(Ejs *ep, const char *fmt, ...); +extern void ejsError(Ejs *ep, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); #ifdef __cplusplus } diff --git a/source4/web_server/ejs/ejsProcs.c b/source4/web_server/ejs/ejsProcs.c index 3b5689b0bd..163835ed6e 100644 --- a/source4/web_server/ejs/ejsProcs.c +++ b/source4/web_server/ejs/ejsProcs.c @@ -544,10 +544,10 @@ static int printlnProc(EjsHandle eid, int argc, MprVar **argv) static int traceProc(EjsHandle eid, int argc, char **argv) { if (argc == 1) { - mprLog(0, argv[0]); + mprLog(0, "%s", argv[0]); } else if (argc == 2) { - mprLog(atoi(argv[0]), argv[1]); + mprLog(atoi(argv[0]), "%s", argv[1]); } else { ejsSetErrorMsg(eid, "Usage: trace([level], message)"); diff --git a/source4/web_server/ejs/miniMpr.h b/source4/web_server/ejs/miniMpr.h index 6fc9c02a16..b34fb2e293 100644 --- a/source4/web_server/ejs/miniMpr.h +++ b/source4/web_server/ejs/miniMpr.h @@ -250,10 +250,10 @@ extern void *mprRealloc(void *ptr, uint size); extern void mprFree(void *ptr); extern char *mprStrdup(const char *str); extern int mprAllocVsprintf(char **msgbuf, int maxSize, const char *fmt, - va_list args); -extern int mprAllocSprintf(char **msgbuf, int maxSize, const char *fmt, ...); + va_list args) PRINTF_ATTRIBUTE(3,0); +extern int mprAllocSprintf(char **msgbuf, int maxSize, const char *fmt, ...) PRINTF_ATTRIBUTE(3,4); extern char *mprItoa(int num, char *buf, int width); -extern void mprLog(int level, const char *fmt, ...); +extern void mprLog(int level, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); extern void mprBreakpoint(const char *file, int line, const char *msg); #endif /* BLD_GOAHEAD_WEBSERVER */ diff --git a/source4/web_server/ejs/var.c b/source4/web_server/ejs/var.c index 53b66d8b1b..ca8eb0fb2a 100644 --- a/source4/web_server/ejs/var.c +++ b/source4/web_server/ejs/var.c @@ -1319,7 +1319,7 @@ MprVar mprCreateObjVar(const char *name, int hashSize) } v.allocatedData = 1; v.name = mprStrdup(name); - mprLog(7, "mprCreateObjVar %s, 0x%x\n", name, v.properties); + mprLog(7, "mprCreateObjVar %s, 0x%p\n", name, v.properties); return v; } |