From a7fdbb176df99f87743876b7dd43fe0deb050f09 Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Thu, 14 Jul 2011 22:43:43 +0000 Subject: [PATCH] Fixed nulldup issues: Jira # NCF-94 --- cf | 2 +- include/ncconfigure.h | 3 +++ libcdmr/cceconstraints.c | 7 ------- libdap2/dceconstraints.c | 7 ------- libdap2/dceparse.c | 7 ------- libdispatch/nc_uri.c | 16 ---------------- ncgen/includes.h | 8 ++------ 7 files changed, 6 insertions(+), 44 deletions(-) diff --git a/cf b/cf index 3623cf70d..fbdaecc8f 100644 --- a/cf +++ b/cf @@ -14,7 +14,7 @@ DAP=1 #cmds="all" #cmds="all check" #cmds="all dist" -#cmds="all distcheck" +cmds="all distcheck" PREFIX="/tmp/install/${HOST}" stddir="/share/ed/local/${HOST}" diff --git a/include/ncconfigure.h b/include/ncconfigure.h index 34a100e72..f83d1935b 100644 --- a/include/ncconfigure.h +++ b/include/ncconfigure.h @@ -29,6 +29,9 @@ extern char* strdup(const char*); #ifndef nulllen #define nulllen(s) ((s)==NULL?0:strlen(s)) #endif +#ifndef nullfree +#define nullfree(s) {if((s)!=NULL) {free(s);} else {}} +#endif #ifndef HAVE_UCHAR typedef unsigned char uchar; diff --git a/libcdmr/cceconstraints.c b/libcdmr/cceconstraints.c index b3e486e66..bc1ac1850 100644 --- a/libcdmr/cceconstraints.c +++ b/libcdmr/cceconstraints.c @@ -9,13 +9,6 @@ #undef DEBUG -#ifndef nulldup -#define nulldup(s) ((s)==NULL?NULL:strdup(s)) -#endif -#ifndef nullfree -#define nullfree(s) if((s)!=NULL) {free(s);} else {} -#endif - static void ceallnodesr(CCEnode* node, NClist* allnodes, CEsort which); diff --git a/libdap2/dceconstraints.c b/libdap2/dceconstraints.c index 4a9893867..c86f792c5 100644 --- a/libdap2/dceconstraints.c +++ b/libdap2/dceconstraints.c @@ -24,13 +24,6 @@ #define DEBUG -#ifndef nulldup -#define nulldup(s) ((s)==NULL?NULL:strdup(s)) -#endif -#ifndef nullfree -#define nullfree(s) {if((s)!=NULL) {free(s);} else {}} -#endif - static char* opstrings[] = OPSTRINGS ; static int mergeprojection(DCEprojection* dst, DCEprojection* src); diff --git a/libdap2/dceparse.c b/libdap2/dceparse.c index bd98f9d78..ffa32450a 100644 --- a/libdap2/dceparse.c +++ b/libdap2/dceparse.c @@ -20,13 +20,6 @@ #include "dceconstraints.h" #include "dceparselex.h" -#ifndef nulldup -#define nulldup(s) ((s)==NULL?NULL:strdup(s)) -#endif -#ifndef nullfree -#define nullfree(s) if((s)!=NULL) {free(s);} else {} -#endif - static Object collectlist(Object list0, Object decl); void diff --git a/libdispatch/nc_uri.c b/libdispatch/nc_uri.c index 9989537d2..ae3c983f3 100644 --- a/libdispatch/nc_uri.c +++ b/libdispatch/nc_uri.c @@ -27,22 +27,6 @@ #define NILLEN(s) ((s)==NULL?0:strlen(s)) #endif -#ifndef nulldup -#define nulldup(s) ((s)==NULL?NULL:strdup(s)) -#endif - -#ifndef HAVE_STRDUP -static char* nulldup(char* s) -{ - char* dup = NULL; - if(s != NULL) { - dup = (char*)malloc(strlen(s)+1); - if(dup != NULL) - strcpy(dup,s); - } - return dup; -} -#endif static char* legalprotocols[] = { "file:", diff --git a/ncgen/includes.h b/ncgen/includes.h index d2e588c9f..ed6ef5b76 100755 --- a/ncgen/includes.h +++ b/ncgen/includes.h @@ -10,7 +10,9 @@ #ifndef NCGEN_INCLUDES_H #define NCGEN_INCLUDES_H +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include #include @@ -46,12 +48,6 @@ #include "util.h" #include "debug.h" -#ifdef HAVE_STRDUP -#define nulldup(s) ((s)==NULL?NULL:strdup(s)) -#else -extern char* nulldup(const char*); -#endif - extern int specialconstants; #endif /* NCGEN_INCLUDES_H */