From b1ab156eda4174fbb7d8408a94d22374527a6335 Mon Sep 17 00:00:00 2001 From: Fyodor Kovin Date: Tue, 7 May 2019 17:27:34 +0200 Subject: [PATCH 1/6] Valid ANSI prototypes Change `int foo();` to `int foo(void);` Signed-off-by: Fyodor Kovin --- h/bpxnet.h | 4 ++-- h/crossmemory.h | 4 ++-- h/dataservice.h | 2 +- h/idcams.h | 2 +- h/le.h | 12 ++++++------ h/logging.h | 10 +++++----- h/metalio.h | 4 ++-- h/qsam.h | 2 +- h/recovery.h | 24 ++++++++++++------------ h/unixfile.h | 2 +- h/zvt.h | 6 +++--- 11 files changed, 36 insertions(+), 36 deletions(-) diff --git a/h/bpxnet.h b/h/bpxnet.h index 8d79d72be..330c0825c 100644 --- a/h/bpxnet.h +++ b/h/bpxnet.h @@ -316,9 +316,9 @@ int socketSetRemove(SocketSet *set, Socket *socket); with select. Yea! */ #ifdef __ZOWE_OS_AIX -Socket** makeEventSockets(); +Socket** makeEventSockets(void); #else -Socket* makeEventSocket(); +Socket* makeEventSocket(void); #endif /* diff --git a/h/crossmemory.h b/h/crossmemory.h index 259624ef6..5d29ae26f 100644 --- a/h/crossmemory.h +++ b/h/crossmemory.h @@ -212,7 +212,7 @@ typedef struct CrossMemoryServerGlobalArea_tag { CMSBuildTimestamp lpaModuleTimestamp; char reserved2[16]; - int (* __ptr32 pccpHandler)(); + int (* __ptr32 pccpHandler)(void); LPMEA lpaModuleInfo; struct { @@ -379,7 +379,7 @@ ZOWE_PRAGMA_PACK_RESET #define CMS_SERVICE_FLAG_CODE_IN_COMMON 0x00000004 /* server side functions (must be authorized and in supervisor mode) */ -void cmsInitializeLogging(); +void cmsInitializeLogging(void); CrossMemoryServer *makeCrossMemoryServer(STCBase *base, const CrossMemoryServerName *serverName, unsigned int flags, int *reasonCode); CrossMemoryServer *makeCrossMemoryServer2( STCBase *base, diff --git a/h/dataservice.h b/h/dataservice.h index 1054c738e..ecbbdc2fc 100644 --- a/h/dataservice.h +++ b/h/dataservice.h @@ -20,7 +20,7 @@ */ -typedef int ExternalAPI(); +typedef int ExternalAPI(void); struct JsonObject_tag; struct HttpServer_tag; diff --git a/h/idcams.h b/h/idcams.h index c426eec13..de143fc6b 100644 --- a/h/idcams.h +++ b/h/idcams.h @@ -31,7 +31,7 @@ typedef struct IDCAMSCommandOutput_tag IDCAMSCommandOutput; #pragma map(idcamsPrintCommandOutput, "RSIDCPCO") #pragma map(idcamsDeleteCommandOutput, "RSIDCDCO") -IDCAMSCommand *idcamsCreateCommand(); +IDCAMSCommand *idcamsCreateCommand(void); int idcamsAddLineToCommand(IDCAMSCommand *cmd, const char *line); int idcamsExecuteCommand(const IDCAMSCommand *cmd, IDCAMSCommandOutput **output, diff --git a/h/le.h b/h/le.h index 56a8903fb..123ed1e5e 100644 --- a/h/le.h +++ b/h/le.h @@ -245,8 +245,8 @@ ZOWE_PRAGMA_PACK_RESET #endif -char *getCAA(); -void showRTL(); +char *getCAA(void); +void showRTL(void); #else /* not __ZOWE_OS_ZOS - */ @@ -319,7 +319,7 @@ void returnGlobalEnvironment(void); #endif /* METTLE */ -RLEAnchor *makeRLEAnchor(); +RLEAnchor *makeRLEAnchor(void); void deleteRLEAnchor(RLEAnchor *anchor); /* implemented for zOS in scheduling.c, for others in le.c */ @@ -329,12 +329,12 @@ RLETask *makeRLETask(RLEAnchor *anchor, void deleteRLETask(RLETask *task); -void initRLEEnvironment(); -void termRLEEnvironment(); +void initRLEEnvironment(void); +void termRLEEnvironment(void); char *makeFakeCAA(char *stackArea, int stackSize); -void abortIfUnsupportedCAA(); +void abortIfUnsupportedCAA(void); #endif /* __LE__ */ diff --git a/h/logging.h b/h/logging.h index c4d498062..94062d6e2 100644 --- a/h/logging.h +++ b/h/logging.h @@ -237,14 +237,14 @@ extern LoggingContext *theLoggingContext; safely assumed to exist in all program execution contexts. Very little of the COMMON library uses globals. */ -LoggingContext *makeLoggingContext(); -void removeLoggingContext(); +LoggingContext *makeLoggingContext(void); +void removeLoggingContext(void); /* create and remove the logging context but do not call the setter and getter function */ -LoggingContext *makeLocalLoggingContext(); +LoggingContext *makeLocalLoggingContext(void); void removeLocalLoggingContext(LoggingContext *context); -LoggingContext *getLoggingContext(); +LoggingContext *getLoggingContext(void); int setLoggingContext(LoggingContext *context); /* should trace macro, it will be a function call if the compiler doensn't support statement expressions */ @@ -327,7 +327,7 @@ int logGetLevel(LoggingContext *context, uint64 compID); /* custom setter and getter functions for logging context */ extern int logSetExternalContext(LoggingContext *context); -extern LoggingContext *logGetExternalContext(); +extern LoggingContext *logGetExternalContext(void); void printStdout(LoggingContext *context, LoggingComponent *component, void *data, char *formatString, va_list argList); void printStderr(LoggingContext *context, LoggingComponent *component, void *data, char *formatString, va_list argList); diff --git a/h/metalio.h b/h/metalio.h index f39ead447..3b6f9bb8d 100644 --- a/h/metalio.h +++ b/h/metalio.h @@ -119,7 +119,7 @@ typedef struct WPLFlags_tag{ } WPLFlags; -typedef int ntFunction(); +typedef int ntFunction(void); #define NT_CREATE 1 #define NT_RETRIEVE 2 @@ -144,7 +144,7 @@ typedef int ntFunction(); #define initSysouts INITSYTS #endif -ntFunction **getNameTokenFunctionTable(); +ntFunction **getNameTokenFunctionTable(void); int getNameTokenValue(int level, char *name, char *token); int createNameTokenPair(int level, char *name, char *token); diff --git a/h/qsam.h b/h/qsam.h index b2da80812..6969b9856 100644 --- a/h/qsam.h +++ b/h/qsam.h @@ -336,7 +336,7 @@ int getline(char *dcb, char *line, int *lengthRead); for restricted environments ITM. getline2 allows you to manage a non-static var (via get/freeEODADBuffer). */ -char *getEODADBuffer(); +char *getEODADBuffer(void); void freeEODADBuffer(char *EODAD); int getline2(char *EODAD, char *dcb, char *line, int *lengthRead); diff --git a/h/recovery.h b/h/recovery.h index d2b90389d..3fdc37bef 100644 --- a/h/recovery.h +++ b/h/recovery.h @@ -360,7 +360,7 @@ int recoveryEstablishRouter(int flags); * Return value: * Always RC_RCV_OK *****************************************************************************/ -int recoveryRemoveRouter(); +int recoveryRemoveRouter(void); /***************************************************************************** * Check if there is a router. @@ -371,7 +371,7 @@ int recoveryRemoveRouter(); * Return value: * Return true if a router has been established. *****************************************************************************/ -bool recoveryIsRouterEstablished(); +bool recoveryIsRouterEstablished(void); /***************************************************************************** * Push a new recovery state. @@ -420,7 +420,7 @@ int recoveryPush(char *name, int flags, char *dumpTitle, * Return value: * N/A *****************************************************************************/ -void recoveryPop(); +void recoveryPop(void); /***************************************************************************** * Set the new dump title @@ -457,7 +457,7 @@ void recoverySetFlagValue(int flag, bool value); * Return value: * N/A *****************************************************************************/ -void recoveryEnableCurrentState(); +void recoveryEnableCurrentState(void); /***************************************************************************** * Disable the current (latest) state. @@ -468,7 +468,7 @@ void recoveryEnableCurrentState(); * Return value: * N/A *****************************************************************************/ -void recoveryDisableCurrentState(); +void recoveryDisableCurrentState(void); /***************************************************************************** * Update router service information. @@ -573,7 +573,7 @@ int recoveryEstablishRouter(int flags); * RC_RCV_OK if the router has been successfully removed, otherwise one of the * RC_RCV_xxxx error codes is returned and errno is set to indicate the error. *****************************************************************************/ -int recoveryRemoveRouter(); +int recoveryRemoveRouter(void); /***************************************************************************** * Check if there is a router. @@ -584,7 +584,7 @@ int recoveryRemoveRouter(); * Return value: * Return true if a router has been established. *****************************************************************************/ -bool recoveryIsRouterEstablished(); +bool recoveryIsRouterEstablished(void); /***************************************************************************** * The following function declarations should not be used directly, @@ -593,7 +593,7 @@ bool recoveryIsRouterEstablished(); RecoveryStateEntry *addRecoveryStateEntry(RecoveryContext *context, char *name, int flags, char *dumpTitle, AnalysisFunction *userAnalysisFunction, void *analysisFunctionUserData, CleanupFunction *userCleanupFunction, void *cleanupFunctionUserData); -RecoveryContext *getRecoveryContext(); +RecoveryContext *getRecoveryContext(void); /***************************************************************************** * Push a new recovery state. @@ -670,7 +670,7 @@ RecoveryContext *getRecoveryContext(); * Return value: * N/A *****************************************************************************/ -void recoveryPop(); +void recoveryPop(void); /***************************************************************************** * TODO needs to be research, we might not be able to affect the core dump in any way @@ -709,7 +709,7 @@ void recoverySetFlagValue(int flag, bool value); * Return value: * N/A *****************************************************************************/ -void recoveryEnableCurrentState(); +void recoveryEnableCurrentState(void); /***************************************************************************** * Disable the current (latest) state. @@ -720,7 +720,7 @@ void recoveryEnableCurrentState(); * Return value: * N/A *****************************************************************************/ -void recoveryDisableCurrentState(); +void recoveryDisableCurrentState(void); #endif /* __ZOWE_OS_ZOS */ @@ -746,7 +746,7 @@ extern int rcvrscxt(RecoveryContext *context); * Recovery context is returned in a case of success. NULL is returned if * the function failed. *****************************************************************************/ -extern RecoveryContext *rcvrgcxt(); +extern RecoveryContext *rcvrgcxt(void); #endif diff --git a/h/unixfile.h b/h/unixfile.h index 63f67c2cd..5bdbc151b 100644 --- a/h/unixfile.h +++ b/h/unixfile.h @@ -483,7 +483,7 @@ int directoryRead(UnixFile *directory, char *entryBuffer, int entryBufferLength, int directoryClose(UnixFile *directory, int *returnCode, int *reasonCode); int setUmask(int mask); -int getUmask(); +int getUmask(void); /* Utility functions that are used in zosfile.c * and httpfileservice.c. Makes and deletes temporary diff --git a/h/zvt.h b/h/zvt.h index fbe07d821..1dd6424b2 100644 --- a/h/zvt.h +++ b/h/zvt.h @@ -108,9 +108,9 @@ ZOWE_PRAGMA_PACK_RESET #pragma map(zvtAllocEntry, "ZVTAENTR") #pragma map(zvtFreeEntry, "ZVTFENTR") -void zvtInit(); -ZVT *zvtGet(); -ZVTEntry *zvtAllocEntry(); +void zvtInit(void); +ZVT *zvtGet(void); +ZVTEntry *zvtAllocEntry(void); void zvtFreeEntry(ZVTEntry *entry); #endif /* H_ZVT_H_ */ From a803b9c58e896bd536d89eed73ae1237b48e53a8 Mon Sep 17 00:00:00 2001 From: Fyodor Kovin Date: Thu, 9 May 2019 16:58:02 +0200 Subject: [PATCH 2/6] alloc.c: void *, size_t - changing `char *` to `void *` in alloc.c has long been a goal - also change the type for size from int to size_t, which is the type returned by the sizeof() operator, functions like strlen(), etc. Signed-off-by: Fyodor Kovin --- c/alloc.c | 140 +++++++++++++++++++++++++++--------------------------- c/qsam.c | 4 +- h/alloc.h | 39 +++++++-------- 3 files changed, 92 insertions(+), 91 deletions(-) diff --git a/c/alloc.c b/c/alloc.c index 6f878acdc..9c658a9b0 100644 --- a/c/alloc.c +++ b/c/alloc.c @@ -60,8 +60,8 @@ static void abend(int requestedAbendCode, int requestedReasonCode){ #ifdef __ZOWE_OS_ZOS -static char *getmain31(int size, int subpool){ - char *data; +static void *getmain31(uint32_t size, unsigned int subpool){ + void *data; __asm(ASM_PREFIX " STORAGE OBTAIN,LENGTH=(%1),SP=(%2),LOC=31,CALLRKY=YES\n" /* ,KEY=8 */ " LGR %0,1" : @@ -70,8 +70,8 @@ static char *getmain31(int size, int subpool){ return data; } -static char *getmain31Key8(int size, int subpool){ - char *data; +static void *getmain31Key8(uint32_t size, unsigned int subpool){ + void *data; __asm(ASM_PREFIX " STORAGE OBTAIN,LENGTH=(%1),SP=(%2),LOC=31,KEY=8\n" " LGR %0,1" : @@ -80,8 +80,8 @@ static char *getmain31Key8(int size, int subpool){ return data; } -static char *getmain31Key0(int size, int subpool){ - char *data; +static void *getmain31Key0(uint32_t size, unsigned int subpool){ + void *data; __asm(ASM_PREFIX " STORAGE OBTAIN,LENGTH=(%1),SP=(%2),LOC=31,KEY=0\n" " LGR %0,1" : @@ -90,8 +90,8 @@ static char *getmain31Key0(int size, int subpool){ return data; } -static char *getmain31Key2(int size, int subpool){ - char *data; +static void *getmain31Key2(uint32_t size, unsigned int subpool){ + void *data; __asm(ASM_PREFIX " STORAGE OBTAIN,LENGTH=(%1),SP=(%2),LOC=31,KEY=2\n" " LGR %0,1" : @@ -100,7 +100,7 @@ static char *getmain31Key2(int size, int subpool){ return data; } -static int freemain31(char *data, int size, int subpool){ +static int freemain31(void *data, uint32_t size, unsigned int subpool){ __asm(ASM_PREFIX " STORAGE RELEASE,LENGTH=(%0),SP=(%1),ADDR=(%2),CALLRKY=YES\n" /* ,KEY=8 */ : : @@ -108,7 +108,7 @@ static int freemain31(char *data, int size, int subpool){ return 1; } -static int freemain31Key8(char *data, int size, int subpool){ +static int freemain31Key8(void *data, uint32_t size, unsigned int subpool){ __asm(ASM_PREFIX " STORAGE RELEASE,LENGTH=(%0),SP=(%1),ADDR=(%2),KEY=8" : : @@ -116,7 +116,7 @@ static int freemain31Key8(char *data, int size, int subpool){ return 1; } -static int freemain31Key0(char *data, int size, int subpool){ +static int freemain31Key0(void *data, uint32_t size, unsigned int subpool){ __asm(ASM_PREFIX " STORAGE RELEASE,LENGTH=(%0),SP=(%1),ADDR=(%2),KEY=0" : : @@ -124,7 +124,7 @@ static int freemain31Key0(char *data, int size, int subpool){ return 1; } -static int freemain31Key2(char *data, int size, int subpool){ +static int freemain31Key2(void *data, uint32_t size, unsigned int subpool){ __asm(ASM_PREFIX " STORAGE RELEASE,LENGTH=(%0),SP=(%1),ADDR=(%2),KEY=2" : : @@ -132,30 +132,30 @@ static int freemain31Key2(char *data, int size, int subpool){ return 1; } -char *allocECSA(int size, int key){ +void *allocECSA(size_t size, unsigned int key){ switch (key){ case 0: - return getmain31Key0(size,241); + return getmain31Key0((uint32_t)size, 241); case 2: - return getmain31Key2(size,241); + return getmain31Key2((uint32_t)size, 241); default: printf("PANIC cannot allocate ECSA in key=%d\n",key); return NULL; } } -int freeECSA(char *data, int size, int key){ +int freeECSA(void *data, size_t size, unsigned int key){ switch (key){ case 0: - return freemain31Key0(data,size,241); + return freemain31Key0(data, (uint32_t)size, 241); case 2: - return freemain31Key2(data,size,241); + return freemain31Key2(data, (uint32_t)size, 241); default: printf("PANIC cannot free ECSA in key=%d\n",key); return 12; } - return freemain31Key0(data,size,241); + return freemain31Key0(data, (uint32_t)size, 241); } #endif /* ZOWE_OS_ZOS */ @@ -167,9 +167,9 @@ int freeECSA(char *data, int size, int key){ * GETMAIN/FREEMAIN and STORAGE do not work on virtual storage above the bar. * Using the IARV64 macro, a program can create and free a memory object and manage the physical frames that back the virtual storage. */ /* Size is specified in megabytes. */ -static char* __ptr64 getmain64(long long sizeInMegabytes, int *returnCode, int *reasonCode){ +static void* __ptr64 getmain64(long long sizeInMegabytes, int *returnCode, int *reasonCode){ - char* __ptr64 data = NULL; + void* __ptr64 data = NULL; int macroRetCode = 0; int macroResCode = 0; @@ -189,9 +189,9 @@ static char* __ptr64 getmain64(long long sizeInMegabytes, int *returnCode, int * } #ifdef _LP64 -static char* __ptr64 getmain64ByToken(long long sizeInMegabytes, long long token, int *returnCode, int *reasonCode){ +static void* __ptr64 getmain64ByToken(long long sizeInMegabytes, long long token, int *returnCode, int *reasonCode){ - char* __ptr64 data = NULL; + void* __ptr64 data = NULL; int macroRetCode = 0; int macroResCode = 0; @@ -209,7 +209,7 @@ static char* __ptr64 getmain64ByToken(long long sizeInMegabytes, long long token } -static void freemain64(char* __ptr64 data, int *returnCode, int *reasonCode){ +static void freemain64(void* __ptr64 data, int *returnCode, int *reasonCode){ int macroRetCode = 0; int macroResCode = 0; @@ -255,14 +255,14 @@ static void freemain64ByToken(long long token, int *returnCode, int *reasonCode) #define ALLOCATIONS_TO_TRACK 25000 -int safeBytes = 0; -int rawBytes = 0; -int k8Bytes = 0; -static int allocationsTracked = 0; +size_t safeBytes = 0; +size_t rawBytes = 0; +size_t k8Bytes = 0; +static unsigned int allocationsTracked = 0; -static char *allocations[ALLOCATIONS_TO_TRACK]; +static void *allocations[ALLOCATIONS_TO_TRACK]; static char *allocationNames[ALLOCATIONS_TO_TRACK]; -static int allocationLengths[ALLOCATIONS_TO_TRACK]; +static size_t allocationLengths[ALLOCATIONS_TO_TRACK]; int showOutstanding(){ int i; @@ -270,9 +270,9 @@ int showOutstanding(){ printf("total allocations done = %d\n",allocationsTracked); /* dumpbuffer ((char *) allocations, 1024);*/ for (i=0; i= ALLOCATIONS_TO_TRACK) { return; } @@ -304,7 +304,7 @@ static void trackAllocation(char *ptr, char *name, int length){ allocationsTracked++; } -static void trackFree(char *ptr, int length){ +static void trackFree(void *ptr, size_t length){ int i; for (i=0; i BIG_MALLOC_THRESHOLD){ if (MALLOC_TRACE_LEVEL >= 1){ printf("MALLOC: big alloc coming %d from %s\n",size,site); @@ -393,7 +393,7 @@ char *safeMalloc(int size, char *site){ #if defined ( METTLE ) res = getmain31(size,SUBPOOL); #elif defined ( __ZOWE_OS_WINDOWS ) || defined(__ZOWE_OS_LINUX) || defined(__ZOWE_OS_AIX) - res = (char*)malloc(size); + res = malloc(size); #else if (TCB_EXISTS){ res = malloc31(size); @@ -419,8 +419,8 @@ char *safeMalloc(int size, char *site){ return res; } -char *safeMalloc2(int size, char *site, int *indicator){ - char *res = NULL; +void *safeMalloc2(size_t size, const char *site, int *indicator){ + void *res = NULL; if (size > BIG_MALLOC_THRESHOLD){ if (MALLOC_TRACE_LEVEL >= 1){ printf("MALLOC: big alloc coming %d from %s\n",size,site); @@ -437,7 +437,7 @@ char *safeMalloc2(int size, char *site, int *indicator){ #if defined ( METTLE ) res = getmain31(size,SUBPOOL); #elif defined (__ZOWE_OS_WINDOWS) || defined (__ZOWE_OS_LINUX)|| defined(__ZOWE_OS_AIX) - res = (char*)malloc(size); + res = malloc(size); #else if (TCB_EXISTS){ res = malloc31(size); @@ -463,9 +463,9 @@ char *safeMalloc2(int size, char *site, int *indicator){ return res; } -char *safeMalloc31(int size, char *site){ +void *safeMalloc31(size_t size, const char *site){ /* printf("allocsize=%d site=%s\n",size,site); */ - char *res = NULL; + void *res = NULL; if (size > BIG_MALLOC_THRESHOLD){ /* 1 meg, roughly */ if (MALLOC_TRACE_LEVEL >= 1){ printf("MALLOC: big alloc coming %d from %s\n",size,site); @@ -496,10 +496,10 @@ char *safeMalloc31(int size, char *site){ return res; } -static char *safeMalloc64Internal(int size, char *site, long long token){ +static void *safeMalloc64Internal(size_t size, const char *site, long long token){ /* printf("allocsize=%d site=%s\n",size,site); */ - char *res = NULL; - int sizeInMegabytes = 0; + void *res = NULL; + size_t sizeInMegabytes = 0; if (size > BIG_MALLOC64_THRESHOLD){ /* 1 meg, roughly */ printf("MALLOC: big alloc coming %d from %s\n",size,site); @@ -516,7 +516,7 @@ static char *safeMalloc64Internal(int size, char *site, long long token){ sizeInMegabytes = (size >> 20) + 1; } #if defined(METTLE) && defined(_LP64) - res = getmain64((long long)sizeInMegabytes,NULL,NULL); + res = getmain64(sizeInMegabytes, NULL, NULL); #elif defined(_LP64) /* LE case */ res = malloc(size); /* According to Redpaper http://www.redbooks.ibm.com/redpapers/pdfs/redp9110.pdf allocated above bar */ #else @@ -534,20 +534,20 @@ static char *safeMalloc64Internal(int size, char *site, long long token){ return res; } -char *safeMalloc64(int size, char *site){ +void *safeMalloc64(size_t size, const char *site){ return safeMalloc64Internal(size,site,0); } -char *safeMalloc64ByToken(int size, char *site, long long token){ +void *safeMalloc64ByToken(size_t size, const char *site, long long token){ return safeMalloc64Internal(size,site,token); } -char *safeMalloc31Key8(int size, char *site){ +void *safeMalloc31Key8(size_t size, const char *site){ /* printf("allocsize=%d site=%s\n",size,site); */ #ifdef TRACK_MEMORY k8Bytes += size; #endif - char *res = NULL; + void *res = NULL; if (size > BIG_MALLOC_THRESHOLD){ /* 10 meg, roughly */ printf("MALLOC: big alloc coming %d from %s\n",size,site); } else if (size == 0){ @@ -556,7 +556,7 @@ char *safeMalloc31Key8(int size, char *site){ printf("MALLOC: negative malloc %d from %s\n",size,site); } #ifdef METTLE - res = getmain31Key8(size,SUBPOOL); + res = getmain31Key8((uint32_t)size, SUBPOOL); #else res = malloc31(size); #endif @@ -569,7 +569,7 @@ char *safeMalloc31Key8(int size, char *site){ } -void safeFree31(char *data, int size){ +void safeFree31(void *data, size_t size){ /* printf("safeFree31: data 0x%p, size %d\n",data, size); */ #ifdef TRACK_MEMORY safeBytes -= size; @@ -577,13 +577,13 @@ void safeFree31(char *data, int size){ #endif #ifdef METTLE - freemain31(data,size,SUBPOOL); + freemain31(data, (uint32_t)size, SUBPOOL); #else free(data); #endif } -static void safeFree64Internal(char *data, int size, long long token){ +static void safeFree64Internal(void *data, size_t size, long long token){ /* printf("safeFree31: data 0x%p, size %d\n",data, size); */ #ifdef TRACK_MEMORY safeBytes -= size; @@ -597,29 +597,29 @@ static void safeFree64Internal(char *data, int size, long long token){ #endif } -void safeFree64(char *data, int size){ +void safeFree64(void *data, size_t size){ safeFree64Internal(data,size,0); } -void safeFree64ByToken(char *data, int size, long long token){ +void safeFree64ByToken(void *data, size_t size, long long token){ safeFree64Internal(data,size,token); } -void safeFree31Key8(char *data, int size){ +void safeFree31Key8(void *data, size_t size){ #ifdef TRACK_MEMORY k8Bytes -= size; #endif /* printf("safeFree31: data 0x%p, size %d\n",data, size); */ #ifdef METTLE - freemain31(data,size,SUBPOOL); + freemain31(data, (uint32_t)size, SUBPOOL); #else free(data); #endif } -void safeFree(char *data, int size){ - safeFree31(data,size); +void safeFree(void *data, size_t size){ + safeFree31(data, (uint32_t)size); } diff --git a/c/qsam.c b/c/qsam.c index a7527cab6..ac808c5c9 100644 --- a/c/qsam.c +++ b/c/qsam.c @@ -40,7 +40,7 @@ char *malloc24(int size){ return data; } -static char *malloc31(int size){ +static void *malloc31(size_t size){ char *data; __asm(ASM_PREFIX " STORAGE OBTAIN,LENGTH=(%[length]),LOC=31\n" @@ -61,7 +61,7 @@ char *free24(char *data, int size){ return NULL; } -static void free31(void *data, int size){ +static void free31(void *data, size_t size){ /* printf("attempting to free, size: %d\n", size);*/ __asm(ASM_PREFIX " STORAGE RELEASE,LENGTH=(%[length]),ADDR=(%[address]),CALLRKY=YES\n" /* ,KEY=8 */ diff --git a/h/alloc.h b/h/alloc.h index 9b6806bc8..9da9cd0d8 100644 --- a/h/alloc.h +++ b/h/alloc.h @@ -13,6 +13,8 @@ #ifndef __ALLOC__ #define __ALLOC__ 1 +#include "zowetypes.h" + /** \file * \brief alloc.h defines an interface for allocating memory that enables some features that are special to each platform. * @@ -37,38 +39,37 @@ #define safeMalloc64ByToken SFMLC64T #endif -char *malloc31(int size); -void free31(void *data, int size); +void *malloc31(size_t size); +void free31(void *data, size_t size); /** * safeMalloc is the primary heap memory allocated for Zowe COMMON c code. It * includes a second argument that defines the call site for diagnostics including leak detection. */ -char *safeMalloc(int size, char *site); -char *safeMalloc2(int size, char *site, int *indicator); -char *safeMalloc31(int size, char *site); -char *safeMalloc31Key8(int size, char *site); +void *safeMalloc(size_t size, const char *site); +void *safeMalloc2(size_t size, const char *site, int *indicator); +void *safeMalloc31(size_t size, const char *site); +void *safeMalloc31Key8(size_t size, const char *site); /** - * safeFree is the primary de-allocator of memory for Zowe COMMON code. It is uses a char pointer - * rather than void pointer for historical reasons. This will be fixed at some time. + * safeFree is the primary de-allocator of memory for Zowe COMMON code. */ -void safeFree(char *data, int size); -void safeFree31(char *data, int size); -void safeFree31Key8(char *data, int size); +void safeFree(void *data, size_t size); +void safeFree31(void *data, size_t size); +void safeFree31Key8(void *data, size_t size); -char *safeMalloc64(int size, char *site); -char *safeMalloc64ByToken(int size, char *site, long long token); +void *safeMalloc64(size_t size, const char *site); +void *safeMalloc64ByToken(size_t size, const char *site, long long token); -void safeFree64(char *data, int size); -void safeFree64ByToken(char *data, int size, long long token); +void safeFree64(void *data, size_t size); +void safeFree64ByToken(void *data, size_t size, long long token); #ifdef __ZOWE_OS_ZOS -char *allocECSA(int size, int key); -int freeECSA(char *data, int size, int key); +void *allocECSA(size_t size, unsigned int key); +int freeECSA(void *data, size_t size, unsigned int key); #endif #ifdef __ZOWE_OS_ZOS @@ -103,11 +104,11 @@ memset(name, 0, sizeof(struct STRUCT31_LOCAL_VAR_NAME(name))) #if defined(_LP64) && !defined(METTLE) #define FREE_STRUCT31(name) \ - safeFree31((char *)name, sizeof(struct name)); \ + safeFree31(name, sizeof(struct name)); \ name = NULL #define FREE_COND_STRUCT31(name) \ if (name) \ - safeFree31((char *)name, sizeof(struct name)); \ + safeFree31(name, sizeof(struct name)); \ name = NULL #else #define FREE_STRUCT31(name) \ From 5b38d992d2d39d04ab4b01cb4ce9f66e1753a7e6 Mon Sep 17 00:00:00 2001 From: Fyodor Kovin Date: Thu, 9 May 2019 17:02:11 +0200 Subject: [PATCH 3/6] utils.c: const correctness, void * - functions like compareIgnoringCase() should really accept `const char *` and not `char *` because they don't modify their arguments. Not havingconst made it difficult to enforce const correctess in callers: the compiler would print warnings about casting const pointers to non-const pointers - functions like dumpbuffer() should really accept `const void *`, not `const char *` because that's the generic pointer type (since ANSI C89) This would also allow us to enable stricter compiler diagnostrics without seeing tons of irrelevant warnings about casting to `char *` Signed-off-by: Fyodor Kovin --- c/utils.c | 103 ++++++++++++++++++++++++++++-------------------------- h/utils.h | 85 +++++++++++++++++++++++--------------------- 2 files changed, 100 insertions(+), 88 deletions(-) diff --git a/c/utils.c b/c/utils.c index 09bfec7af..456cd66c7 100644 --- a/c/utils.c +++ b/c/utils.c @@ -35,7 +35,7 @@ #include "printables_for_dump.h" #include "timeutls.h" -char * strcopy_safe(char * dest, const char * source, int dest_size) { +char *strcopy_safe(char *dest, const char *source, int dest_size) { if( dest_size == 0 ) return dest; dest[0] = '\0'; @@ -82,7 +82,7 @@ int nullTerminate(char *str, int len){ return 0; } -int isZeros(char *data, int offset, int length){ +int isZeros(const char *data, int offset, int length) { int i; for (i=0; istart; int i; @@ -472,7 +475,7 @@ int tknTextEquals(token *t, char *str, char *match){ return 1; } -char *tknText(token *t, char *str){ +char *tknText(token *t, const char *str) { int len = t->end - t->start; char *text = safeMalloc(len+1,"Token Text"); memcpy(text,str+t->start,len); @@ -480,7 +483,7 @@ char *tknText(token *t, char *str){ return text; } -int tknInt(token *t, char *str){ +int tknInt(token *t, const char *str) { int x = 0; int i; @@ -530,7 +533,7 @@ char *simpleHexFill(char *buffer, int formatWidth, int value){ return buffer; } -char *simpleHexPrint(char *buffer, char *data, int len){ +char *simpleHexPrint(char *buffer, const char *data, int len){ int i; for (i=0; i>4]; @@ -540,7 +543,7 @@ char *simpleHexPrint(char *buffer, char *data, int len){ return buffer; } -char *simpleHexPrintLower(char *buffer, char *data, int len){ +char *simpleHexPrintLower(char *buffer, const char *data, int len) { int i; for (i=0; i>4]; @@ -560,12 +563,11 @@ static char *ascii = "`abcdefghijklmno" "pqrstuvwxyz{|}~ "; -void dumpBufferToStream(const char *buffer, int length, /* FILE* */void *traceOut) -{ - int i; +void dumpBufferToStream(const void *in_buffer, int length, /* FILE* */void *traceOut) { int index = 0; int last_index; char lineBuffer[256]; + const char *buffer = in_buffer; #ifdef __ZOWE_EBCDIC const unsigned char *trans = printableEBCDIC; @@ -622,7 +624,7 @@ void dumpBufferToStream(const char *buffer, int length, /* FILE* */void *traceOu #endif } -void dumpbuffer(const char *buffer, int length) { +void dumpbuffer(const void *buffer, int length) { #ifdef METTLE dumpBufferToStream(buffer, length, 0); #else @@ -630,13 +632,14 @@ void dumpbuffer(const char *buffer, int length) { #endif } -void hexdump(char *buffer, int length, int nominalStartAddress, int formatWidth, char *pad1, char *pad2){ - int i; +void hexdump(const void *in_buffer, int length, int nominalStartAddress, + int formatWidth, const char *pad1, const char *pad2) { int index = 0; int last_index = length-1; char lineBuffer[256]; const unsigned char *trans = printableEBCDIC; int pad1Len = strlen(pad1); + const char *buffer = in_buffer; while (index <= last_index){ int pos; @@ -665,17 +668,18 @@ void hexdump(char *buffer, int length, int nominalStartAddress, int formatWidth, fflush(stdout); } -void dumpbuffer2(char *buffer, int length){ +void dumpbuffer2(const void *buffer, int length) { hexdump(buffer,length,0,32," "," "); } -void dumpbufferA(const char *buffer, int length){ +void dumpbufferA(const void *in_buffer, int length){ int i; int index = 0; int last_index; char lineBuffer[256]; const unsigned char *trans = printableASCII; void *traceOut = (void*)stdout; + const char *buffer = in_buffer; if (length <= 0){ return; @@ -747,7 +751,7 @@ char *strupcase(char *s){ /* problems: hash mark at 0x23, dollar at 0x24 */ -int percentEncode(char *value, char *buffer, int len){ +int percentEncode(const char *value, char *buffer, int len){ int i; int pos = 0; @@ -878,7 +882,7 @@ int percentEncode(char *value, char *buffer, int len){ return pos; } -char *cleanURLParamValue(ShortLivedHeap *slh, char *value){ +char *cleanURLParamValue(ShortLivedHeap *slh, const char *value){ int len = strlen(value); int i; int pos = 0; @@ -967,7 +971,7 @@ static int getBitsForChar(char c){ } } -int decodeBase64(char *s, char *result){ +int decodeBase64(const char *s, char *result){ int sLen = strlen(s); int numGroups = sLen / 4; int missingBytesInLastGroup = 0; @@ -1029,7 +1033,8 @@ static char binToEB64[] ={0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xd1,0xd2 #define ENCODE64_SIZE(SZ) (2 + 4 * ((SZ + 2) / 3)) -char *encodeBase64(ShortLivedHeap *slh, char *buf, int size, int *resultSize, int useEbcdic){ +char *encodeBase64(ShortLivedHeap *slh, const char *buf, int size, + int *resultSize, int useEbcdic){ char *data = (char*)buf; char *result = NULL; char equalsChar = (useEbcdic ? '=' : 0x3D); @@ -1137,7 +1142,7 @@ char EBCDICEncodeTable [32] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'Y', 'Z', '2', '3', '4', '5', '6', '7'}; int base32Decode (int alphabet, - char *input, + const char *input, char *output, int *outputLength, int useEBCDIC) { @@ -1220,7 +1225,7 @@ int base32Decode (int alphabet, } int base32Encode (int alphabet, - char *input, + const char *input, int inputLength, char *output, int *outputLength, @@ -1374,13 +1379,13 @@ ShortLivedHeap *makeShortLivedHeap64(int blockSize, int maxBlocks){ return makeShortLivedHeapInternal(blockSize,maxBlocks,TRUE); } -char *SLHAlloc(ShortLivedHeap *slh, int size){ +void *SLHAlloc(ShortLivedHeap *slh, int size) { /* expand for fullword alignment */ int rem = size & 0x3; if (rem != 0){ size += (4-rem); } - char *data; + void *data; /* printf("slh=%d\n",slh);fflush(stdout); printf("SLHAlloc me=0x%x size=%d bc=%d\n",slh,size,slh->blockCount);fflush(stdout); */ int remainingHeapBytes = (slh->blockSize * (slh->maxBlocks - slh->blockCount)); @@ -1433,14 +1438,14 @@ char *SLHAlloc(ShortLivedHeap *slh, int size){ slh->bytesRemaining -= size; data = slh->activeBlock; slh->activeBlock += size; - return (char *)data; + return data; } void SLHFree(ShortLivedHeap *slh){ ListElt *chain = slh->blockChain; while (chain){ ListElt *elt = chain; - char *data = chain->data-4; + void *data = chain->data-4; int size = *((int*)data); /* printf("SLHFree %d bytes\n",size); */ if (slh->is64){ @@ -1449,13 +1454,13 @@ void SLHFree(ShortLivedHeap *slh){ safeFree31(data,size+4); } chain = chain->next; - safeFree((char*)elt,sizeof(ListElt)); + safeFree(elt, sizeof(ListElt)); } - safeFree((char*)slh,sizeof(ShortLivedHeap)); + safeFree(slh, sizeof(ShortLivedHeap)); } -char *noisyMalloc(int size){ - char *data = safeMalloc(size,"NoisyMalloc"); +void *noisyMalloc(int size) { + void *data = safeMalloc(size,"NoisyMalloc"); if (data == 0){ printf("malloc failure for allocation of %d bytes\n",size); fflush(stdout); @@ -1491,7 +1496,7 @@ int stringListLength(StringList *list){ } } -int stringListContains(StringList *list, char *s){ +int stringListContains(StringList *list, const char *s) { if (list->head){ StringListElt *elt = list->head; while (elt){ @@ -1553,7 +1558,8 @@ StringListElt *firstStringListElt(StringList *list){ return list->head; } -char *stringListPrint(StringList *list, int start, int max, char *separator, char quoteChar){ +char *stringListPrint(StringList *list, int start, int max, + const char *separator, char quoteChar) { int separatorLen = strlen(separator); char *out = NULL; int pos = 0; @@ -1592,7 +1598,7 @@ char *stringListPrint(StringList *list, int start, int max, char *separator, cha return out; } -char *stringConcatenate(ShortLivedHeap *slh, char *s1, char *s2){ +char *stringConcatenate(ShortLivedHeap *slh, const char *s1, const char *s2) { int l1 = strlen(s1); int l2 = strlen(s2); char *s = SLHAlloc(slh,l1+l2+1); @@ -1880,9 +1886,8 @@ int decimalToOctal(int decimal) { #define debugPrintf(formatString, ...) #endif -int matchWithWildcards(char *pattern, int patternLen, - char *s, int len, int flags){ - +int matchWithWildcards(const char *pattern, int patternLen, + const char *s, int len, unsigned int flags) { int wildcardPositions[MAX_WILDCARDS]; int wildcardState[MAX_WILDCARDS]; int fixedWidths[MAX_WILDCARDS+1]; diff --git a/h/utils.h b/h/utils.h index 790d51ef6..ddcebd062 100644 --- a/h/utils.h +++ b/h/utils.h @@ -34,12 +34,14 @@ extern "C" { #define indexOfStringInsensitive IDXSTRNS #endif -char * strcopy_safe(char * dest, const char * source, int dest_size); +char *strcopy_safe(char *dest, const char *source, int dest_size); -int indexOf(char *str, int len, char c, int startPos); +int indexOf(const char *str, int len, char c, int startPos); int lastIndexOf(const char *str, int len, char c); -int indexOfString(char *str, int len, char *searchString, int startPos); -int indexOfStringInsensitive(char *str, int len, char *searchString, int startPos); +int indexOfString(const char *str, int len, const char *searchString, + int startPos); +int indexOfStringInsensitive(const char *str, int len, const char *searchString, + int startPos); /* max() is not a standard macro. Windows introduces this and they are wrong */ @@ -56,11 +58,11 @@ typedef struct token_struct{ int end; /* exclusive */ } token; -int isZeros(char *data, int offset, int length); +int isZeros(const char *data, int offset, int length); -int isBlanks(char *data, int offset, int length); +int isBlanks(const char *data, int offset, int length); -int hasText(char* data, int offset, int length); +int hasText(const char *data, int offset, int length); int parseInt(const char *str, int start, int end); @@ -86,24 +88,25 @@ int nullTerminate(char *str, int len); Doesn't care about any fancy languages */ int isCharAN(char c); -token* tknGetDecimal(char *str, int len, int start); -token* tknGetQuoted(char *str, int len, int start, char quote, char escape); +token *tknGetDecimal(const char *str, int len, int start); +token *tknGetQuoted(const char *str, int len, int start, char quote, + char escape); -token* tknGetAlphanumeric(char *str, int len, int start); +token *tknGetAlphanumeric(const char *str, int len, int start); /* alphanumeric plus hash dollar and at sign */ -token* tknGetStandard(char *str, int len, int start); +token *tknGetStandard(const char *str, int len, int start); -token* tknGetNonWhitespace(char *str, int len, int start); +token *tknGetNonWhitespace(const char *str, int len, int start); -token* tknGetTerminating(char *str, int len, - char *match, int start); +token *tknGetTerminating(const char *str, int len, + const char *match, int start); -int tknTextEquals(token *t, char *str, char *match); +int tknTextEquals(token *t, const char *str, const char *match); void freeToken(token *t); -char *tknText(token *t, char *str); -int tknInt(token *t, char *str); +char *tknText(token *t, const char *str); +int tknInt(token *t, const char *str); int tknLength(token *t); #ifndef __LONGNAME__ @@ -122,21 +125,22 @@ int tknLength(token *t); * A utility to dump hex data to stdout */ -void dumpbuffer(const char *buffer, int length); +void dumpbuffer(const void *buffer, int length); /** * A utility to dump data to a FILE* pointer */ -void dumpBufferToStream(const char *buffer, int length, /* FILE* */void *traceOut); +void dumpBufferToStream(const void *buffer, int length, /* FILE* */void *traceOut); /** * A utility to generate precisely formatted hex strings. */ -void dumpbufferA(const char *buffer, int length); +void dumpbufferA(const void *buffer, int length); -int hexFill(char *buffer, int offset, int prePad, int formatWidth, int postPad, int value); +int hexFill(char *buffer, int offset, int prePad, int formatWidth, + int postPad, int value); /** * A utility that is a convenience function to format a hex strings from integers. @@ -145,11 +149,12 @@ int hexFill(char *buffer, int offset, int prePad, int formatWidth, int postPad, */ char *simpleHexFill(char *buffer, int formatWidth, int value); -char *simpleHexPrint(char *buffer, char *data, int len); -char *simpleHexPrintLower(char *buffer, char *data, int len); -void hexdump(char *buffer, int length, int nominalStartAddress, int formatWidth, char *pad1, char *pad2); -void dumpbuffer2(char *buffer, int length); -int compareIgnoringCase(char *s1, char *s2, int len); +char *simpleHexPrint(char *buffer, const char *data, int len); +char *simpleHexPrintLower(char *buffer, const char *data, int len); +void hexdump(const void *buffer, int length, int nominalStartAddress, + int formatWidth, const char *pad1, const char *pad2); +void dumpbuffer2(const void *buffer, int length); +int compareIgnoringCase(const char *s1, const char *s2, int len); char *strupcase(char *s); typedef struct ListElt_tag { @@ -207,7 +212,7 @@ ShortLivedHeap *makeShortLivedHeap64(int blockSize, int maxBlocks); * with exactly this size. */ -char *SLHAlloc(ShortLivedHeap *slh, int size); +void *SLHAlloc(ShortLivedHeap *slh, int size); /** * \brief This will reclaim the whole heap. @@ -217,20 +222,21 @@ char *SLHAlloc(ShortLivedHeap *slh, int size); void SLHFree(ShortLivedHeap *slh); -char *cleanURLParamValue(ShortLivedHeap *slh, char *value); -int percentEncode(char *value, char *buffer, int len); +char *cleanURLParamValue(ShortLivedHeap *slh, const char *value); +int percentEncode(const char *value, char *buffer, int len); -int decodeBase64(char *s, char *result); -char *encodeBase64(ShortLivedHeap *slh, char *buf, int size, int *resultSize, int useEbcdic); +int decodeBase64(const char *s, char *result); +char *encodeBase64(ShortLivedHeap *slh, const char *buf, int size, + int *resultSize, int useEbcdic); char *destructivelyUnasciify(char *s); int base32Decode (int alphabet, - char *input, + const char *input, char *output, int *outputLength, int useEBCDIC); int base32Encode (int alphabet, - char *input, + const char *input, int inputLength, char *output, int *outputLength, @@ -244,7 +250,7 @@ int base32Encode (int alphabet, #define INVALID_ENCODE_LENGTH 2 #define ENCODE_LENGTH_TOO_SMALL 3 -char *noisyMalloc(int size); +void *noisyMalloc(int size); typedef struct StringListElt_tag{ char *string; @@ -287,11 +293,12 @@ StringList *makeStringList(ShortLivedHeap *slh); /** \brief Current member count of string list */ int stringListLength(StringList *list); -char *stringListPrint(StringList *list, int start, int max, char *separator, char quoteChar); +char *stringListPrint(StringList *list, int start, int max, + const char *separator, char quoteChar); /** \brief Membership test for string in a String in a String List */ -int stringListContains(StringList *list, char *s); +int stringListContains(StringList *list, const char *s); char *stringListLast(StringList *list); int addToStringListUnique(StringList *list, char *s); @@ -307,7 +314,7 @@ void addToStringList(StringList *list, char *s); */ StringListElt *firstStringListElt(StringList *list); -char *stringConcatenate(ShortLivedHeap *slh, char *s1, char *s2); +char *stringConcatenate(ShortLivedHeap *slh, const char *s1, const char *s2); typedef struct CharStream_tag{ void *internalStream; @@ -378,8 +385,8 @@ void convertUnixToISO(int unixTime, ISOTime *timeStamp); /* Converts output of f #define STRLIKE_UTF8_PATTERN 0x04 #define STRLIKE_MIMIC_SQL 0x08 -int matchWithWildcards(char *pattern, int patternLen, - char *s, int len, int flags); +int matchWithWildcards(const char *pattern, int patternLen, + const char *s, int len, unsigned int flags); #if defined(__cplusplus) } /* end of extern "C" */ From bf74c436c376c15a815c1aaceefaf0ba84eccade Mon Sep 17 00:00:00 2001 From: Fyodor Kovin Date: Thu, 9 May 2019 17:03:35 +0200 Subject: [PATCH 4/6] add stddef.h to zowetypes Signed-off-by: Fyodor Kovin --- h/zowetypes.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/h/zowetypes.h b/h/zowetypes.h index f4532bc82..464b4cb73 100644 --- a/h/zowetypes.h +++ b/h/zowetypes.h @@ -15,10 +15,12 @@ #define __ZOWETYPES__ 1 #ifndef __IBM_METAL__ +#include #include #include #else #include +#include #include #endif From c79e5a74df7f5b0b7b52a8e8f30a48220145fc8c Mon Sep 17 00:00:00 2001 From: Fyodor Kovin Date: Mon, 13 May 2019 06:00:17 -0400 Subject: [PATCH 5/6] Fix a number of warnings WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/h/bpxnet.h Obsolete non-prototype-style function declaration. ERROR CCN3438 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/bpxskt.c The variable "status" might be used before it is set. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/bpxskt.c Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "getCallersKey". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "getCallersKey". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "getCallersKey". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "getCallersKey". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "getCallersKey". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "getCallersKey". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "printf". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "printf". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "printf". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "printf". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "printf". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "printf". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "printf". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "printf". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "printf". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "printf". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "printf". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "printf". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "printf". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "printf". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "printf". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "printf". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/cmutils.c No function prototype given for "printf". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/collections.c Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/collections.c Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/collections.c Obsolete non-prototype-style function declaration. WARNING CCN3451 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/collections.c The target integral type cannot hold all possible values of the source integral type. WARNING CCN3451 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/collections.c The target integral type cannot hold all possible values of the source integral type. WARNING CCN3451 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/collections.c The target integral type cannot hold all possible values of the source integral type. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/h/bpxnet.h Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/crossmemory.c Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/crossmemory.c No function prototype given for "getLocalTimeOffset". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/h/bpxnet.h Obsolete non-prototype-style function declaration. WARNING CCN3426 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/dataservice.c An assignment expression is used as a condition. An equality comparison (==) may have been intended. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/h/bpxnet.h Obsolete non-prototype-style function declaration. ERROR CCN3438 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/datasetjson.c The variable "record" might be used before it is set. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/h/bpxnet.h Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/discovery.c Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/discovery.c No function prototype given for "getGDA". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/h/bpxnet.h Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/h/bpxnet.h Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpserver.c Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpserver.c Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpserver.c No function prototype given for "makeWSReadMachine". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpserver.c No function prototype given for "asciify". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpserver.c No function prototype given for "asciify". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpserver.c No function prototype given for "asciify". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpserver.c No function prototype given for "asciify". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpserver.c No function prototype given for "getFineGrainedTime". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpserver.c Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpserver.c No function prototype given for "isLowerCasePasswordAllowed". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpserver.c No function prototype given for "isLowerCasePasswordAllowed". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpserver.c Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpserver.c No function prototype given for "getFineGrainedTime". WARNING CCN3207 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpserver.c Integer constant (4096 * 1000000) is out of range. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpserver.c No function prototype given for "getFineGrainedTime". WARNING CCN3426 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpserver.c An assignment expression is used as a condition. An equality comparison (==) may have been intended. WARNING CCN3426 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpserver.c An assignment expression is used as a condition. An equality comparison (==) may have been intended. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpserver.c No function prototype given for "asciify". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/h/bpxnet.h Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpfileservice.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpfileservice.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpfileservice.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpfileservice.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpfileservice.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpfileservice.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpfileservice.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpfileservice.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/httpfileservice.c No function prototype given for "respondWithUnixFileNotFound". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/h/bpxnet.h Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/h/bpxnet.h Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/json.c No function prototype given for "write". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/le.c Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/le.c Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/le.c Obsolete non-prototype-style function declaration. ERROR CCN3343 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/le.c Redeclaration of initRLEEnvironment differs from previous declaration on line 332 of "/proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/h/le.h". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/le.c Obsolete non-prototype-style function declaration. WARNING CCN3451 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/logging.c The target integral type cannot hold all possible values of the source integral type. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/logging.c Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/logging.c Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/logging.c No function prototype given for "makeZoweAnchor". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/logging.c Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/logging.c Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/logging.c Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/zos.c No function prototype given for "safVerifyInternal". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/zos.c No function prototype given for "safVerifyInternal". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/zos.c No function prototype given for "safVerifyInternal". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/zos.c No function prototype given for "safVerifyInternal". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/zos.c No function prototype given for "safVerifyInternal". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c No function prototype given for "getRecoveryContext". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c No function prototype given for "setDummyESPIE". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c No function prototype given for "getRecoveryRouterAddress". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c No function prototype given for "getRecoveryContext". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c No function prototype given for "deleteESTAEX". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c No function prototype given for "getRecoveryContext". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c No function prototype given for "getRecoveryContext". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c No function prototype given for "getLatestState". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c No function prototype given for "getLatestState". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c No function prototype given for "getLatestState". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c No function prototype given for "getLatestState". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c No function prototype given for "getRecoveryContext". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c No function prototype given for "getRecoveryContext". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/recovery.c No function prototype given for "getLatestState". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/scheduling.c No function prototype given for "getLoggingContext". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/scheduling.c Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/h/bpxnet.h Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/h/bpxnet.h Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/stcbase.c No function prototype given for "zosPost". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/stcbase.c No function prototype given for "startRLETask". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/stcbase.c No function prototype given for "zosPost". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/stcbase.c No function prototype given for "startRLETask". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/stcbase.c No function prototype given for "zosPost". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/utils.c No function prototype given for "strncasecmp". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/utils.c No function prototype given for "incrementPlaceValues". WARNING CCN3426 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/zosfile.c An assignment expression is used as a condition. An equality comparison (==) may have been intended. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/zosfile.c Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/zvt.c Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/zvt.c Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/zvt.c No function prototype given for "getZVTHandle". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/zvt.c Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/zvt.c No function prototype given for "getZVTHandle". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/c/zvt.c Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/h/bpxnet.h Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/zss.c Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/zss.c Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/zss.c No function prototype given for "makeInternalAPIMap". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/zss.c Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/zss.c Obsolete non-prototype-style function declaration. ERROR CCN3099 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/zss.c Unexpected argument. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/zss.c No function prototype given for "initVersionComponents". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/zss.c No function prototype given for "initLoggingComponents". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/zss.c No function prototype given for "installUnixFileContentsService". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/zss.c No function prototype given for "installUnixFileRenameService". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/zss.c No function prototype given for "installUnixFileCopyService". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/zss.c No function prototype given for "installUnixFileMakeDirectoryService". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/zss.c No function prototype given for "installUnixFileTouchService". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/zss.c No function prototype given for "installUnixFileMetadataService". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/zss.c No function prototype given for "installUnixFileTableOfContentsService". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/zss.c No function prototype given for "installVSAMDatasetContentsService". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/zss.c No function prototype given for "installDatasetMetadataService". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/zss.c No function prototype given for "installDatasetContentsService". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/zss.c No function prototype given for "installOMVSService". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/h/bpxnet.h Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/serviceUtils.c No function prototype given for "memcpy". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/serviceUtils.c No function prototype given for "memcpy". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/h/bpxnet.h Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/authService.c No function prototype given for "strcasecmp". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/authService.c No function prototype given for "strcasecmp". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/authService.c No function prototype given for "strcasecmp". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/authService.c No function prototype given for "strcasecmp". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/h/bpxnet.h Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/h/bpxnet.h Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/unixFileService.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/unixFileService.c No function prototype given for "getCharsetCode". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/unixFileService.c No function prototype given for "getCharsetCode". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/unixFileService.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/unixFileService.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/unixFileService.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/unixFileService.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/unixFileService.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/unixFileService.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/unixFileService.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/unixFileService.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/unixFileService.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/unixFileService.c No function prototype given for "strtoul". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/unixFileService.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/unixFileService.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/unixFileService.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/unixFileService.c No function prototype given for "respondWithUnixFileNotFound". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/unixFileService.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/unixFileService.c No function prototype given for "respondWithUnixFileNotFound". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/unixFileService.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/unixFileService.c No function prototype given for "respondWithUnixFileNotFound". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/h/bpxnet.h Obsolete non-prototype-style function declaration. ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/datasetService.c No function prototype given for "strcmp". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/datasetService.c No function prototype given for "strcmp". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/datasetService.c No function prototype given for "strcmp". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/datasetService.c No function prototype given for "respondWithJsonError". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/datasetService.c No function prototype given for "strcmp". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/datasetService.c No function prototype given for "strcmp". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/datasetService.c No function prototype given for "strcmp". ERROR CCN3304 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/datasetService.c No function prototype given for "strcmp". WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/h/bpxnet.h Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/deps/zowe-common-c/h/bpxnet.h Obsolete non-prototype-style function declaration. WARNING CCN3450 /proj/kbm/pdkovi/src/zowe/2019-05-09/zss/c/zis/client.c Obsolete non-prototype-style function declaration. Signed-off-by: Fyodor Kovin --- c/bpxskt.c | 8 ++++---- c/cmutils.c | 8 +++++--- c/collections.c | 12 ++++++------ c/crossmemory.c | 4 ++-- c/dataservice.c | 3 +-- c/datasetjson.c | 2 +- c/discovery.c | 6 ++++-- c/dynalloc.c | 1 + c/httpfileservice.c | 1 + c/httpserver.c | 20 ++++++++++---------- c/json.c | 1 + c/le.c | 8 ++++---- c/logging.c | 12 ++++++------ c/recovery.c | 26 +++++++++++++------------- c/scheduling.c | 3 ++- c/stcbase.c | 1 + c/utils.c | 4 ++++ c/zos.c | 12 ++++++++++++ c/zosfile.c | 4 ++-- c/zvt.c | 8 ++++---- h/bpxnet.h | 2 +- h/charsets.h | 2 +- h/http.h | 2 ++ h/httpserver.h | 3 ++- h/le.h | 2 +- 25 files changed, 91 insertions(+), 64 deletions(-) diff --git a/c/bpxskt.c b/c/bpxskt.c index a2f063999..c7eace059 100644 --- a/c/bpxskt.c +++ b/c/bpxskt.c @@ -204,7 +204,7 @@ Socket *tcpClient3(SocketAddress *socketAddress, int returnValue = 0; *returnCode = *reasonCode = 0; int *reasonCodePtr; - int status; + int status = 0; #ifndef _LP64 reasonCodePtr = (int*) (0x80000000 | ((int)reasonCode)); @@ -1627,7 +1627,7 @@ int not_main(int argc, char **argv){ int port = argc >= 3 ? atoi(argv[2]) : 80; InetAddr *inetAddr = NULL; char readBuffer[1024]; - int errno; + int __errno; int retcode; inetAddr = getAddressByName(addressString); @@ -1635,12 +1635,12 @@ int not_main(int argc, char **argv){ if (inetAddr){ SocketAddress *socketAddress = makeSocketAddr(inetAddr,(unsigned short)port); - Socket *socket = tcpClient(socketAddress,&errno,&retcode); + Socket *socket = tcpClient(socketAddress,&__errno,&retcode); int i; int bytesRead; fflush(stdout); - bytesRead = socketRead(socket,readBuffer,200,&errno,&retcode); + bytesRead = socketRead(socket,readBuffer,200,&__errno,&retcode); dumpbuffer(readBuffer,bytesRead); for (i=0; i<5; i++){ printf("SLEEP %d\n",i+1);fflush(stdout); diff --git a/c/cmutils.c b/c/cmutils.c index e9531c9a8..eb6c7be9a 100644 --- a/c/cmutils.c +++ b/c/cmutils.c @@ -15,10 +15,12 @@ #include #include #include +#include #else #include #include #include +#include #endif #include "zowetypes.h" @@ -26,7 +28,7 @@ #include "cmutils.h" #include "zos.h" -static int getCallersKey() { +static int getCallersKey(void) { int key = 0; __asm( @@ -1117,9 +1119,9 @@ static int testCellPool(void) { #ifdef CMUTILS_TEST -int main() { +int main(void) { #else -static int notMain() { +static int notMain(void) { #endif printf("info: starting cmutils test\n"); diff --git a/c/collections.c b/c/collections.c index c65519cc6..feffa879e 100644 --- a/c/collections.c +++ b/c/collections.c @@ -180,7 +180,7 @@ void *htGet(hashtable *ht, void *key){ int loopCount = 0; if (hashentry != NULL){ - int (*compare)() = ht->comparator; + int (*compare)(void *, void *) = ht->comparator; while (hashentry != NULL){ if (compare? (compare)(hashentry->key,key) : @@ -297,7 +297,7 @@ static int htPut2(hashtable *ht, void *key, void *value){ hashentry *entry = entry = ht->backbone[place]; hashentry *tail = NULL; hashentry *newEntry = NULL; - int (*compare)() = ht->comparator; + int (*compare)(void *, void *) = ht->comparator; if (entry != NULL){ while (entry != NULL){ @@ -479,7 +479,7 @@ int htRemove(hashtable *ht, void *key){ hashentry *prev = NULL; int place = hashcode%(ht->backboneSize); hashentry *entry = ht->backbone[place]; - int (*compare)() = ht->comparator; + int (*compare)(void *, void *) = ht->comparator; if (entry != NULL){ while (entry != NULL){ if (compare ? (compare)(entry->key,key) : (entry->key == key)){ @@ -677,7 +677,7 @@ void lhtDestroy(LongHashtable *lht){ } void *lhtGet(LongHashtable *lht, int64 key){ - int place = key%(lht->backboneSize); + int place = (int) (key%(lht->backboneSize)); LongHashEntry *prev = NULL; LongHashEntry* hashentry = lht->backbone[place]; int loopCount = 0; @@ -708,7 +708,7 @@ void *lhtGet(LongHashtable *lht, int64 key){ /* returns whether replaced */ int lhtPut(LongHashtable *ht, int64 key, void *value){ - int place = key%(ht->backboneSize); + int place = (int) (key%(ht->backboneSize)); LongHashEntry *entry = entry = ht->backbone[place]; LongHashEntry *tail = NULL; LongHashEntry *newEntry = NULL; @@ -742,7 +742,7 @@ int lhtPut(LongHashtable *ht, int64 key, void *value){ /* remove returns non-zero if it really removes anything */ int lhtRemove(LongHashtable *ht, int64 key){ - int place = key%(ht->backboneSize); + int place = (int) (key%(ht->backboneSize)); LongHashEntry *prev = NULL; LongHashEntry *entry = entry = ht->backbone[place]; if (entry != NULL){ diff --git a/c/crossmemory.c b/c/crossmemory.c index 129dbfb0a..5ad9c72ec 100644 --- a/c/crossmemory.c +++ b/c/crossmemory.c @@ -434,10 +434,10 @@ static void getSTCK(uint64 *stckValue) { __asm(" STCK 0(%0)" : : "r"(stckValue)); } -int64 getLocalTimeOffset() { +int64 getLocalTimeOffset(void) { CVT * __ptr32 cvt = *(void * __ptr32 * __ptr32)0x10; void * __ptr32 cvtext2 = cvt->cvtext2; - int64 *cvtldto = (int64 * __ptr32)(cvtext2 + 0x38); + int64 *cvtldto = (int64 * __ptr32)(/*note that we're adding a number to a void **/cvtext2 + 0x38); return *cvtldto; } diff --git a/c/dataservice.c b/c/dataservice.c index ebe239071..e25e66144 100644 --- a/c/dataservice.c +++ b/c/dataservice.c @@ -78,8 +78,7 @@ const char* pluginTypeString(int pluginType) { PlugInMapEntry *e = plugInMap; while (e->pluginString != 0) { - // this seems like an error, but it appears vestigial - if (pluginType = e->pluginType) { + if (pluginType == e->pluginType) { return e->pluginString; } ++e; diff --git a/c/datasetjson.c b/c/datasetjson.c index 3de2ebf89..805ffa9c1 100644 --- a/c/datasetjson.c +++ b/c/datasetjson.c @@ -728,7 +728,7 @@ static void updateVSAMDatasetWithJSON(HttpResponse *response, JsonObject *json, /* TODO: note that non-KSDS uses a pointer to the ? */ /* TODO: get Key before storing */ char *key = jsonArrayGetString(recordArray,i); /* TODO: get key AND record here */ - char *record; /* TODO: correctly parse the record, minding your decided format from the above loop. */ + char *record = NULL; /* TODO: correctly parse the record, minding your decided format from the above loop. */ /* TODO: point to the key, based on which type of dataset it is. See pointByXXX functions in respondWithVSAMDataset() for example syntax */ if (update) { getRecord(outACB, tempRecord, &recordLength); /* in VSAM, we need to GET for update before we can write over a record with a later PUT for update */ diff --git a/c/discovery.c b/c/discovery.c index bed75c82f..8fbf68edd 100644 --- a/c/discovery.c +++ b/c/discovery.c @@ -69,7 +69,7 @@ static void showVersionInfo(DiscoveryContext *context, char *ssName){ } } -static GDA *getGDA(){ +static GDA *getGDA(void){ CVT *cvt = getCVT(); ECVT *ecvt = getECVT(); GDA *gda = (GDA*)cvt->cvtgda; @@ -77,6 +77,8 @@ static GDA *getGDA(){ } static int isPointerCommon(GDA *gda, void *pointer){ +/* FIXME: why does arithmetic even work on void pointers? + are they just converted to int impilictly? */ if ( ((pointer >= gda->gdacsa) && (pointer < gda->gdacsa+gda->gdacsasz)) || ((pointer >= gda->gdasqa) && (pointer < gda->gdasqa+gda->gdasqasz)) || ((pointer >= gda->gdaesqa) && (pointer < gda->gdaesqa+gda->gdaesqas)) || @@ -848,7 +850,7 @@ static void scanSlowSoftware(ZOSModel *model){ context->cicsTraceLevel = 0; context->db2TraceLevel = 0; context->model = model; - discoverSubsystems(context,SOFTWARE_TYPE_ALL,NULL); + discoverSubsystems(context,SOFTWARE_TYPE_ALL,NULL); /* Converting 4294967295 to type "int" does not preserve its value */ zowelog(NULL, LOG_COMP_DISCOVERY, ZOWE_LOG_DEBUG2, "after discoverySubsystems() in slowScan\n"); fflush(stdout); diff --git a/c/dynalloc.c b/c/dynalloc.c index c75fd0eb7..e3193ca10 100644 --- a/c/dynalloc.c +++ b/c/dynalloc.c @@ -281,6 +281,7 @@ int AllocIntReader(char *datasetOutputClass, rc = -1; + /* Converting 128 to type "signed char" does not preserve its value */ below2G->textUnits[0] = createInt8TextUnit(DALRECFM, DALRECFM_F); if (below2G->textUnits[0] == NULL) { break; diff --git a/c/httpfileservice.c b/c/httpfileservice.c index 818141e38..d519083e8 100644 --- a/c/httpfileservice.c +++ b/c/httpfileservice.c @@ -32,6 +32,7 @@ #include "charsets.h" #include "unixfile.h" #include "httpfileservice.h" +#include "httpserver.h" #ifdef __ZOWE_OS_ZOS #define NATIVE_CODEPAGE CCSID_EBCDIC_1047 diff --git a/c/httpserver.c b/c/httpserver.c index 18997889b..c1260bc99 100644 --- a/c/httpserver.c +++ b/c/httpserver.c @@ -173,7 +173,7 @@ static char crlf[] ={ 0x0d, 0x0a}; #define DEFAULT_UMASK 0022 #endif -static int64 getFineGrainedTime(); +static int64 getFineGrainedTime(void); /* worry about compareIgnoringCase @@ -520,7 +520,7 @@ static void writeToBigBuffer(BigBuffer *buffer, char *newData, int length){ static void writeByteToBigBuffer(BigBuffer *buffer, int b){ char c; - c = b&0xff; + c = (char)b&0xff; writeToBigBuffer(buffer,&c,1); } @@ -568,7 +568,7 @@ static void addWSFrame(WSMessage *message, WSFrame *newFrame){ } } -static WSReadMachine *makeWSReadMachine(){ +static WSReadMachine *makeWSReadMachine(void){ WSReadMachine *machine = (WSReadMachine*)safeMalloc(sizeof(WSReadMachine),"WSReadMachine"); memset(machine,0,sizeof(WSReadMachine)); machine->payloadStream = makeBigBuffer(256,NULL); @@ -611,7 +611,7 @@ static void addNewWSFrame(HttpWorkElement *workElement, memcpy(workElement->buffer+2,&longLength,8); } else if (payloadLength >= 126){ workElement->buffer[1] = 126; - unsigned short shortLength = payloadLength&0xFFFF; + unsigned short shortLength = (unsigned short) payloadLength&0xFFFF; memcpy(workElement->buffer+2,&shortLength,2); } else{ workElement->buffer[1] = payloadLength; @@ -2350,12 +2350,12 @@ static char *getCookieValue(HttpRequest *request, char *cookieName){ } #ifdef __ZOWE_OS_ZOS -static int isLowerCasePasswordAllowed(){ +static int isLowerCasePasswordAllowed(void){ RCVT* rcvt = getCVT()->cvtrac; return (RCVTFLG3_BIT_RCVTPLC & (rcvt->rcvtflg3)); /* if lower-case pw allowed */ } #else -static int isLowerCasePasswordAllowed(){ +static int isLowerCasePasswordAllowed(void){ return TRUE; } #endif @@ -2621,9 +2621,9 @@ int extractBasicAuth(HttpRequest *request, HttpHeader *authHeader){ #ifdef __ZOWE_OS_ZOS -#define ONE_SECOND (4096*1000000) /* one second in STCK */ +#define ONE_SECOND (4096llu*1000000llu) /* one second in STCK */ -static int64 getFineGrainedTime(){ +static int64 getFineGrainedTime(void){ int64 stck = 0; unsigned long long outSeconds = 0; __asm(ASM_PREFIX @@ -2933,7 +2933,7 @@ static void serveRequest(HttpService* service, HttpResponse* response, proxyServe(service, request, response); } else { char* serviceArgProblem = NULL; - if (serviceArgProblem = processServiceRequestParams(service, response)) { + if (0 != (serviceArgProblem = processServiceRequestParams(service, response))) { respondWithError(response, 404, serviceArgProblem); // Response is finished on return } else { @@ -3126,7 +3126,7 @@ static int serviceLoop(Socket *socket){ break; } HttpRequest *request = NULL; - while (request = dequeueHttpRequest(parser)){ + while (NULL != (request = dequeueHttpRequest(parser))) { HttpHeader *header; HttpResponse *response = makeHttpResponse(request,parser->slh,socket); /* parse URI after request and response ready for work, have SLH's, etc */ diff --git a/c/json.c b/c/json.c index f310a5a7c..241f75614 100644 --- a/c/json.c +++ b/c/json.c @@ -36,6 +36,7 @@ #include #include #include +#include #endif diff --git a/c/le.c b/c/le.c index f1d2f55b1..a504291b3 100644 --- a/c/le.c +++ b/c/le.c @@ -86,7 +86,7 @@ LibraryFunction libraryFunctionTable[LIBRARY_FUNCTION_COUNT] #endif }; -char *getCAA(){ +char *getCAA(void){ char *realCAA = NULL; #if !defined(METTLE) && defined(_LP64) @@ -110,7 +110,7 @@ char *getCAA(){ #define LE_MAX_SUPPORTED_ZOS 0x01020300u #endif -void abortIfUnsupportedCAA() { +void abortIfUnsupportedCAA(void) { #ifdef __ZOWE_OS_ZOS ECVT *ecvt = getECVT(); unsigned int zosVersion = ecvt->ecvtpseq; @@ -162,7 +162,7 @@ static LibraryFunction *findLibraryFunction(int rtlVectorOffset){ #define ESTIMATED_RTL_VECTOR_SIZE 0xB00 -void showRTL(){ +void showRTL(void){ CAA *caa = (CAA*)getCAA(); void **rtlVector = caa->runtimeLibraryVectorTable; printf("RTL Vector at 0x%x\n",rtlVector); @@ -271,7 +271,7 @@ void initRLEEnvironment(RLEAnchor *anchor) { } -void termRLEEnvironment() { +void termRLEEnvironment(void) { recoveryRemoveRouter(); diff --git a/c/logging.c b/c/logging.c index 82561a5a9..6b01f767f 100644 --- a/c/logging.c +++ b/c/logging.c @@ -102,7 +102,7 @@ static void logHTDestroy(LoggingHashTable *logHT) { } static void *logHTGet(LoggingHashTable *logHT, int64 key) { - int place = key % (logHT->backboneSize); + int place = (int) (key % (logHT->backboneSize)); LoggingHashEntry *prev = NULL; LoggingHashEntry *hashentry = logHT->backbone[place]; int loopCount = 0; @@ -201,7 +201,7 @@ static void removeComponentTable(LoggingComponentTable *table) { } -static LoggingZoweAnchor *makeZoweAnchor() { +static LoggingZoweAnchor *makeZoweAnchor(void) { LoggingZoweAnchor *anchor = (LoggingZoweAnchor *)safeMalloc(sizeof(LoggingZoweAnchor), "LoggingZoweAnchor"); memset(anchor, 0, sizeof(LoggingZoweAnchor)); @@ -250,7 +250,7 @@ static void cleanLoggingComponentInLogHT(void *component) { memset(comp, 0, sizeof(LoggingComponent)); } -LoggingContext *makeLocalLoggingContext() { +LoggingContext *makeLocalLoggingContext(void) { LoggingContext *context = (LoggingContext *)safeMalloc(sizeof(LoggingContext),"LoggingContext"); memcpy(context->eyecatcher, "RSLOGCTX", sizeof(context->eyecatcher)); @@ -260,7 +260,7 @@ LoggingContext *makeLocalLoggingContext() { return context; } -LoggingContext *makeLoggingContext() { +LoggingContext *makeLoggingContext(void) { LoggingContext *existingContext = getLoggingContext(); if (existingContext == NULL) { @@ -298,7 +298,7 @@ void removeLocalLoggingContext(LoggingContext *context) { } -void removeLoggingContext() { +void removeLoggingContext(void) { LoggingContext *context = getLoggingContext(); removeLocalLoggingContext(context); @@ -362,7 +362,7 @@ LoggingContext *theLoggingContext = NULL; /* this is a writable static, which */ #endif -LoggingContext *getLoggingContext() { +LoggingContext *getLoggingContext(void) { #ifdef LOGGING_CUSTOM_CONTEXT_GETTER return logGetExternalContext(); #else /* LOGGING_CUSTOM_CONTEXT_GETTER */ diff --git a/c/recovery.c b/c/recovery.c index e3409d833..39119b5a5 100644 --- a/c/recovery.c +++ b/c/recovery.c @@ -104,7 +104,7 @@ static void resetESPIE(int token) { } -static int setDummyESPIE() { +static int setDummyESPIE(void) { int wasProblemState = supervisorMode(FALSE); @@ -214,7 +214,7 @@ static ESTAEXFeedback setESTAEX(void * __ptr32 userExit, void *userData, char fl return localFeedback; } -static ESTAEXFeedback deleteESTAEX() { +static ESTAEXFeedback deleteESTAEX(void) { ESTAEXFeedback localFeedback; @@ -271,7 +271,7 @@ static void storageRelease(void *data, int size){ ); } -static void * __ptr32 getRecoveryRouterAddress() { +static void * __ptr32 getRecoveryRouterAddress(void) { void * __ptr32 address = NULL; @@ -598,7 +598,7 @@ static void * __ptr32 getRecoveryRouterAddress() { } #define recoveryDESCTs RCVDSECT -void recoveryDESCTs(){ +void recoveryDESCTs(void){ __asm( " DS 0H \n" @@ -696,7 +696,7 @@ void recoveryDESCTs(){ #endif -RecoveryContext *getRecoveryContext() { +RecoveryContext *getRecoveryContext(void) { #ifdef CUSTOM_CONTEXT_GETTER return rcvrgcxt(); #else @@ -716,7 +716,7 @@ RecoveryContext *getRecoveryContext() { #endif /* CUSTOM_CONTEXT_GETTER */ } -static RecoveryStateEntry *getLatestState() { +static RecoveryStateEntry *getLatestState(void) { RecoveryContext *context = getRecoveryContext(); return context ? context->recoveryStateChain : NULL; } @@ -889,7 +889,7 @@ int recoveryEstablishRouter(int flags) { #elif defined(__ZOWE_OS_AIX) || defined(__ZOWE_OS_LINUX) -static void generateCoreDump() { +static void generateCoreDump(void) { if(!fork()) { abort(); } @@ -1033,7 +1033,7 @@ int recoveryEstablishRouter(int flags) { #ifdef __ZOWE_OS_ZOS -int recoveryRemoveRouter() { +int recoveryRemoveRouter(void) { RecoveryContext *context = getRecoveryContext(); if (context == NULL) { @@ -1074,7 +1074,7 @@ int recoveryRemoveRouter() { #elif defined(__ZOWE_OS_AIX) || defined(__ZOWE_OS_LINUX) -int recoveryRemoveRouter() { +int recoveryRemoveRouter(void) { RecoveryContext *context = getRecoveryContext(); if (context == NULL) { @@ -1324,7 +1324,7 @@ int recoveryPush(char *name, int flags, char *dumpTitle, #endif /* __ZOWE_OS_ZOS */ -void recoveryPop() { +void recoveryPop(void) { RecoveryContext *context = getRecoveryContext(); if (context != NULL) { removeRecoveryStateEntry(context); @@ -1366,21 +1366,21 @@ void recoverySetFlagValue(int flag, bool value) { } } -void recoveryEnableCurrentState() { +void recoveryEnableCurrentState(void) { RecoveryStateEntry *state = getLatestState(); if (state != NULL) { state->state |= RECOVERY_STATE_ENABLED; } } -void recoveryDisableCurrentState() { +void recoveryDisableCurrentState(void) { RecoveryStateEntry *state = getLatestState(); if (state != NULL) { state->state &= ~RECOVERY_STATE_ENABLED; } } -bool recoveryIsRouterEstablished() { +bool recoveryIsRouterEstablished(void) { return getRecoveryContext() ? true : false; } diff --git a/c/scheduling.c b/c/scheduling.c index 6636d89aa..b9f275348 100644 --- a/c/scheduling.c +++ b/c/scheduling.c @@ -35,6 +35,7 @@ #include "recovery.h" #include "scheduling.h" #include "openprims.h" +#include "logging.h" #ifndef __ZOWE_OS_ZOS #error non-z/OS environments are not supported @@ -509,7 +510,7 @@ int zosPost(void *ecb, int completionCode){ } #define schedulingDSECTs SKDDSECT -void schedulingDSECTs(){ +void schedulingDSECTs(void){ __asm( diff --git a/c/stcbase.c b/c/stcbase.c index d63b54dc3..00e889014 100644 --- a/c/stcbase.c +++ b/c/stcbase.c @@ -36,6 +36,7 @@ #include "openprims.h" #include "collections.h" #include "stcbase.h" +#include "scheduling.h" /* handleReadySockets is a highly system-specific way of waking running asynchronous IO work. Windows and linux are different enought to need some data-hiding diff --git a/c/utils.c b/c/utils.c index 456cd66c7..221218251 100644 --- a/c/utils.c +++ b/c/utils.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #endif @@ -1886,6 +1887,9 @@ int decimalToOctal(int decimal) { #define debugPrintf(formatString, ...) #endif +static int incrementPlaceValues(int *placeValues, + int lim, int digits); + int matchWithWildcards(const char *pattern, int patternLen, const char *s, int len, unsigned int flags) { int wildcardPositions[MAX_WILDCARDS]; diff --git a/c/zos.c b/c/zos.c index abc1dd00a..bfeff17b1 100644 --- a/c/zos.c +++ b/c/zos.c @@ -748,6 +748,18 @@ static char *makeCountedString(char *name, return result; } +static int safVerifyInternal(int options, + char *userid, + char *password, + char *newPassword, + ACEE **aceeHandle, + void **messageAreaPtr, + int subpool, + char *applicationName, + int sessionType, + int *racfStatus, int *racfReason); + + int safVerify(int options, char *userid, char *password, ACEE **aceeHandle, int *racfStatus, int *racfReason){ diff --git a/c/zosfile.c b/c/zosfile.c index 56dc04f5c..f3bc4e38b 100644 --- a/c/zosfile.c +++ b/c/zosfile.c @@ -761,7 +761,7 @@ int fileCopy(const char *existingFile, const char *newFile, int forceCopy){ printf("Failed to disable automatic conversion. Unexpected results may occur.\n"); } - while (bytesRead = fileRead(fileCheckFrom, buffer, FILE_BUFFER_SIZE, &returnCode, &reasonCode)){ + while (0 != (bytesRead = fileRead(fileCheckFrom, buffer, FILE_BUFFER_SIZE, &returnCode, &reasonCode))){ if (bytesRead == -1) { #ifdef DEBUG printf("Failed to read file %s: (return = 0x%x, reason = 0x%x)\n", existingFile, returnCode, reasonCode); @@ -1589,7 +1589,7 @@ int setUmask(int mask) { return returnValue; } -int getUmask() { +int getUmask(void) { printf("UMASK: This is a dirty hack.\n"); int previous = setUmask(0000); diff --git a/c/zvt.c b/c/zvt.c index 8561fe061..0b63e1423 100644 --- a/c/zvt.c +++ b/c/zvt.c @@ -80,7 +80,7 @@ static void freeECSAStorage(void *data, } -static ZVT * __ptr32 * getZVTHandle() { +static ZVT * __ptr32 * getZVTHandle(void) { CVT *cvt = *(CVT * __ptr32 *)0x10; ECVT *ecvt = cvt->cvtecvt; @@ -95,7 +95,7 @@ static void getSTCK(uint64_t *stckValue) { } -void zvtInit() { +void zvtInit(void) { ZVT * __ptr32 * currentZVTHandle = getZVTHandle(); ZVT * __ptr32 oldZVT = NULL; @@ -146,13 +146,13 @@ void zvtInit() { } -ZVT *zvtGet() { +ZVT *zvtGet(void) { return *getZVTHandle(); } -ZVTEntry *zvtAllocEntry() { +ZVTEntry *zvtAllocEntry(void) { ZVTEntry * __ptr32 zvte = allocateECSAStorage(sizeof(ZVTEntry), ZVTE_KEY, ZVTE_SUBPOOL); diff --git a/h/bpxnet.h b/h/bpxnet.h index 330c0825c..0cb7f4a52 100644 --- a/h/bpxnet.h +++ b/h/bpxnet.h @@ -384,7 +384,7 @@ int setSocketBlockingMode(Socket *socket, int isNonBlocking, int setSocketOption(Socket *socket, int level, int optionName, int optionDataLength, char *optionData, int *returnCode, int *reasonCode); -int socketSend(Socket *s, char *buffer, int len, int *errno); +int socketSend(Socket *s, char *buffer, int len, int *_errno_); Socket *socketAccept(Socket *serverSocket, int *returnCode, int *reasonCode); diff --git a/h/charsets.h b/h/charsets.h index 3ee93bb65..ba4200197 100644 --- a/h/charsets.h +++ b/h/charsets.h @@ -91,7 +91,7 @@ int convertCharset(char *input, int *conversionOutputLength, int *reasonCode); - +int getCharsetCode(char *charsetName); #endif diff --git a/h/http.h b/h/http.h index c5797568b..b1e0c9733 100644 --- a/h/http.h +++ b/h/http.h @@ -203,6 +203,8 @@ static const char methodDELETE[] = { 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x00}; void requestStringHeader(HttpRequest *request, int inEbcdic, char *name, char *value); void requestIntHeader(HttpRequest *request, int inEbcdic, char *name, int value); +void asciify(char *s, int len); + #endif /* _COMMON_HTTP_H_ */ diff --git a/h/httpserver.h b/h/httpserver.h index bf4bd433f..3ab8e57d5 100644 --- a/h/httpserver.h +++ b/h/httpserver.h @@ -464,6 +464,7 @@ jsonPrinter *initWSJsonPrinting(WSSession *session, int maxFrameSize); void flushWSJsonPrinting(WSSession *session); void respondWithUnixFileContents(HttpResponse* response, char *absolutePath, int jsonMode); +void respondWithUnixFileNotFound(HttpResponse* response, int jsonMode); void respondWithUnixFileContents2(HttpService* service, HttpResponse* response, char *absolutePath, int jsonMode); void respondWithUnixFileContentsWithAutocvtMode(HttpService* service, HttpResponse* response, char *absolutePath, int jsonMode, int convert); @@ -537,7 +538,7 @@ int setHttpCloseConversationTrace(int toWhat); int setHttpAuthTrace(int toWhat); #endif - +void respondWithJsonError(HttpResponse *response, char *error, int statusCode, char *statusMessage); /* This program and the accompanying materials are diff --git a/h/le.h b/h/le.h index 123ed1e5e..25afb03a5 100644 --- a/h/le.h +++ b/h/le.h @@ -329,7 +329,7 @@ RLETask *makeRLETask(RLEAnchor *anchor, void deleteRLETask(RLETask *task); -void initRLEEnvironment(void); +void initRLEEnvironment(RLEAnchor *anchor); void termRLEEnvironment(void); char *makeFakeCAA(char *stackArea, int stackSize); From 65c60f1ad9ba4e95a34af0a86049a5548427480b Mon Sep 17 00:00:00 2001 From: Fyodor Kovin Date: Mon, 13 May 2019 07:02:22 -0400 Subject: [PATCH 6/6] Fix name collisions and some further problems - F_LOCK is an integer constant, the original struct name is `struct flock` - sleep is `uint sleep(uint)` not `void sleep(int)` - ntFunction is really an "umbrella" typedef for several different function signatures, so just define it with ... now Signed-off-by: Fyodor Kovin --- c/bpxskt.c | 9 +++++---- c/crossmemory.c | 3 ++- c/mtlskt.c | 3 ++- c/zosfile.c | 12 ++++++------ h/bpxnet.h | 2 +- h/dataservice.h | 2 +- h/metalio.h | 2 +- h/unixfile.h | 4 ++-- 8 files changed, 20 insertions(+), 17 deletions(-) diff --git a/c/bpxskt.c b/c/bpxskt.c index c7eace059..6956923f8 100644 --- a/c/bpxskt.c +++ b/c/bpxskt.c @@ -129,16 +129,17 @@ int setSocketTrace(int toWhat) { return was; } -void sleep(int seconds){ - int returnValue; - int *returnValuePtr; +unsigned int sleep(unsigned int seconds){ + unsigned int returnValue; + unsigned int *returnValuePtr; #ifndef _LP64 - returnValuePtr = (int*) (0x80000000 | ((int)&returnValue)); + returnValuePtr = (unsigned int*) (0x80000000 | ((int)&returnValue)); #else returnValuePtr = &returnValue; #endif BPXSLP(seconds,returnValuePtr); + return returnValue; } void bpxSleep(int seconds) diff --git a/c/crossmemory.c b/c/crossmemory.c index 5ad9c72ec..11bee3e89 100644 --- a/c/crossmemory.c +++ b/c/crossmemory.c @@ -3268,9 +3268,10 @@ static int handleModifyCommand(STCBase *base, CIB *cib, STCConsoleCommandType co return 0; } -static void sleep(int seconds){ +static unsigned int sleep(unsigned int seconds){ int waitValue = seconds * 100; __asm(" STIMER WAIT,BINTVL=%0\n" : : "m"(waitValue)); + return 0; } static int isEnvironmentReady() { diff --git a/c/mtlskt.c b/c/mtlskt.c index 59b11f029..3b9e09fa9 100644 --- a/c/mtlskt.c +++ b/c/mtlskt.c @@ -127,9 +127,10 @@ static int socketTrace = 0; -void sleep(int seconds){ +unsigned int sleep(unsigned int seconds){ int waitValue = seconds * 100; __asm(" STIMER WAIT,BINTVL=%0\n" : : "m"(waitValue)); + return 0; } void bpxSleep(int seconds) diff --git a/c/zosfile.c b/c/zosfile.c index f3bc4e38b..33c529ca5 100644 --- a/c/zosfile.c +++ b/c/zosfile.c @@ -1642,14 +1642,14 @@ int fileSetLock(UnixFile *file, int *returnCode, int *reasonCode) { #endif int action = F_SET_LOCK; - F_LOCK flockdata; + BpxFLock flockdata; flockdata.l_type = F_WRITE_LOCK; flockdata.l_whence = F_SEEK_SET; flockdata.l_start = 0; flockdata.l_len = F_WHENCE_TO_END; flockdata.l_pid = 0; - F_LOCK *fnctl_ptr = &flockdata; + BpxFLock *fnctl_ptr = &flockdata; BPXFCT(&file->fd, &action, @@ -1677,14 +1677,14 @@ int fileGetLock(UnixFile *file, int *returnCode, int *reasonCode, int *isLocked) #endif int action = F_GET_LOCK; - F_LOCK flockdata; + BpxFLock flockdata; flockdata.l_type = F_WRITE_LOCK; flockdata.l_whence = F_SEEK_SET; flockdata.l_start = 0; flockdata.l_len = F_WHENCE_TO_END; flockdata.l_pid = 0; - F_LOCK *fnctl_ptr = &flockdata; + BpxFLock *fnctl_ptr = &flockdata; BPXFCT(&file->fd, &action, @@ -1716,14 +1716,14 @@ int fileUnlock(UnixFile *file, int *returnCode, int *reasonCode) { #endif int action = F_SET_LOCK; - F_LOCK flockdata; + BpxFLock flockdata; flockdata.l_type = F_UNLOCK; flockdata.l_whence = F_SEEK_SET; flockdata.l_start = 0; flockdata.l_len = F_WHENCE_TO_END; flockdata.l_pid = 0; - F_LOCK *fnctl_ptr = &flockdata; + BpxFLock *fnctl_ptr = &flockdata; BPXFCT(&file->fd, &action, diff --git a/h/bpxnet.h b/h/bpxnet.h index 0cb7f4a52..79c5a1e29 100644 --- a/h/bpxnet.h +++ b/h/bpxnet.h @@ -221,7 +221,7 @@ typedef struct hostent_tag{ /* sleep(int seconds) is standard in linux */ #if !defined(__ZOWE_OS_LINUX) && !defined(__ZOWE_OS_AIX) -void sleep(int secs); +unsigned int sleep(unsigned int); #endif /* Set socket tracing; returns prior value */ diff --git a/h/dataservice.h b/h/dataservice.h index ecbbdc2fc..671babe58 100644 --- a/h/dataservice.h +++ b/h/dataservice.h @@ -20,7 +20,7 @@ */ -typedef int ExternalAPI(void); +typedef int ExternalAPI(struct DataService_tag *,struct HttpServer_tag *); struct JsonObject_tag; struct HttpServer_tag; diff --git a/h/metalio.h b/h/metalio.h index 3b6f9bb8d..f05f72851 100644 --- a/h/metalio.h +++ b/h/metalio.h @@ -119,7 +119,7 @@ typedef struct WPLFlags_tag{ } WPLFlags; -typedef int ntFunction(void); +typedef int ntFunction(int *, ...); #define NT_CREATE 1 #define NT_RETRIEVE 2 diff --git a/h/unixfile.h b/h/unixfile.h index 5bdbc151b..a82d0972d 100644 --- a/h/unixfile.h +++ b/h/unixfile.h @@ -445,13 +445,13 @@ typedef struct F_CVT_tag { /* Length Values */ #define F_WHENCE_TO_END 0 /* Locked file is from whence to end of the file */ -typedef struct F_LOCK_TAG { +typedef struct BpxFLock_Tag { short l_type; short l_whence; int64 l_start; int64 l_len; unsigned int l_pid; -} F_LOCK; +} BpxFLock; int fileDisableConversion(UnixFile *file, int *returnCode, int *reasonCode); int fileSetLock(UnixFile *file, int *returnCode, int *reasonCode);