Changeset: 82a64ac1967b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/82a64ac1967b
Modified Files:
        clients/Tests/exports.stable.out
        gdk/gdk_utils.c
        gdk/gdk_utils.h
        tools/monetdbe/monetdbe.c
        tools/mserver/shutdowntest.c
Branch: default
Log Message:

Code cleanup.


diffs (119 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -285,8 +285,8 @@ bool GDKembedded(void);
 bool GDKexiting(void);
 _Noreturn void GDKfatal(_In_z_ _Printf_format_string_ const char *format, ...) 
__attribute__((__format__(__printf__, 1, 2)));
 jmp_buf GDKfataljump;
-bit GDKfataljumpenable;
-str GDKfatalmsg;
+bool GDKfataljumpenable;
+char *GDKfatalmsg;
 gdk_return GDKfilepath(char *buf, size_t bufsize, int farmid, const char *dir, 
const char *nme, const char *ext) __attribute__((__access__(write_only, 1, 2)));
 void GDKfree(void *blk);
 char *GDKgetbuf(void);
@@ -327,9 +327,9 @@ stream *GDKstdout;
 ssize_t GDKstrFromStr(unsigned char *restrict dst, const unsigned char 
*restrict src, ssize_t len, char quote);
 int GDKstrcasecmp(const char *s1, const char *s2);
 char *GDKstrcasestr(const char *haystack, const char *needle);
-str GDKstrdup(const char *s) __attribute__((__malloc__)) 
__attribute__((__malloc__(GDKfree, 1))) __attribute__((__warn_unused_result__));
+char *GDKstrdup(const char *s) __attribute__((__malloc__)) 
__attribute__((__malloc__(GDKfree, 1))) __attribute__((__warn_unused_result__));
 int GDKstrncasecmp(const char *str1, const char *str2, size_t l1, size_t l2);
-str GDKstrndup(const char *s, size_t n) __attribute__((__malloc__)) 
__attribute__((__malloc__(GDKfree, 1))) __attribute__((__warn_unused_result__));
+char *GDKstrndup(const char *s, size_t n) __attribute__((__malloc__)) 
__attribute__((__malloc__(GDKfree, 1))) __attribute__((__warn_unused_result__));
 gdk_return GDKtolower(allocator *ma, char **restrict buf, size_t *restrict 
buflen, const char *restrict s) __attribute__((__access__(read_write, 2))) 
__attribute__((__access__(read_write, 3)));
 gdk_return GDKtoupper(allocator *ma, char **restrict buf, size_t *restrict 
buflen, const char *restrict s) __attribute__((__access__(read_write, 2))) 
__attribute__((__access__(read_write, 3)));
 gdk_return GDKtracer_fill_comp_info(BAT *id, BAT *component, BAT *log_level);
diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -1503,8 +1503,8 @@ GDKclrerr(void)
 }
 
 jmp_buf GDKfataljump;
-str GDKfatalmsg;
-bit GDKfataljumpenable = 0;
+char *GDKfatalmsg;
+bool GDKfataljumpenable = false;
 
 /* coverity[+kill] */
 void
diff --git a/gdk/gdk_utils.h b/gdk/gdk_utils.h
--- a/gdk/gdk_utils.h
+++ b/gdk/gdk_utils.h
@@ -99,11 +99,11 @@ gdk_export void *GDKzalloc(size_t size)
 gdk_export void *GDKrealloc(void *pold, size_t size)
        __attribute__((__alloc_size__(2)))
        __attribute__((__warn_unused_result__));
-gdk_export str GDKstrdup(const char *s)
+gdk_export char *GDKstrdup(const char *s)
        __attribute__((__malloc__))
        __attribute__((__malloc__(GDKfree, 1)))
        __attribute__((__warn_unused_result__));
-gdk_export str GDKstrndup(const char *s, size_t n)
+gdk_export char *GDKstrndup(const char *s, size_t n)
        __attribute__((__malloc__))
        __attribute__((__malloc__(GDKfree, 1)))
        __attribute__((__warn_unused_result__));
@@ -132,8 +132,8 @@ gdk_export const char *GDKlibversion(voi
 
 // these are used in embedded mode to jump out of GDKfatal
 gdk_export jmp_buf GDKfataljump;
-gdk_export str GDKfatalmsg;
-gdk_export bit GDKfataljumpenable;
+gdk_export char *GDKfatalmsg;
+gdk_export bool GDKfataljumpenable;
 
 /* Timers
  * The following relative timers are available for inspection.
diff --git a/tools/monetdbe/monetdbe.c b/tools/monetdbe/monetdbe.c
--- a/tools/monetdbe/monetdbe.c
+++ b/tools/monetdbe/monetdbe.c
@@ -613,7 +613,7 @@ monetdbe_startup(monetdbe_database_inter
        int workers, memory;
        gdk_return gdk_res;
 
-       GDKfataljumpenable = 1;
+       GDKfataljumpenable = true;
 
        if(setjmp(GDKfataljump) != 0) {
                assert(0);
@@ -628,7 +628,7 @@ monetdbe_startup(monetdbe_database_inter
 
        if (monetdbe_embedded_initialized) {
                set_error(mdbe, createException(MAL, 
"monetdbe.monetdbe_startup", "MonetDBe is already initialized"));
-               GDKfataljumpenable = 0;
+               GDKfataljumpenable = false;
                return;
        }
 
@@ -761,7 +761,7 @@ monetdbe_startup(monetdbe_database_inter
        if (dbdir && !monetdbe_embedded_url)
                set_error(mdbe, createException(MAL, 
"monetdbe.monetdbe_startup", MAL_MALLOC_FAIL));
 cleanup:
-       GDKfataljumpenable = 0;
+       GDKfataljumpenable = false;
        if (mdbe->msg)
                monetdbe_shutdown_internal();
 }
diff --git a/tools/mserver/shutdowntest.c b/tools/mserver/shutdowntest.c
--- a/tools/mserver/shutdowntest.c
+++ b/tools/mserver/shutdowntest.c
@@ -97,7 +97,7 @@ static str monetdb_initialize(void) {
                goto cleanup;
        }
 
-       GDKfataljumpenable = 1;
+       GDKfataljumpenable = true;
        if(setjmp(GDKfataljump) != 0) {
                retval = GDKfatalmsg;
                // we will get here if GDKfatal was called.
@@ -261,7 +261,7 @@ static str monetdb_initialize(void) {
                retval = GDKstrdup("mal_init() failed");
                goto cleanup;
        }
-       GDKfataljumpenable = 0;
+       GDKfataljumpenable = false;
 
        if (retval != MAL_SUCCEED) {
                printf("Failed to load SQL function: %s\n", retval);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to