]> git.samba.org - metze/wireshark/wip.git/blobdiff - epan/except.c
radiotap: Updates to the radiotap dissector to avoid confusion.
[metze/wireshark/wip.git] / epan / except.c
index 0efe53b45d8a9e7ea43a31f86335ee9747171253..2420b3376004c7d6307722e0f14a6a610507911f 100644 (file)
@@ -35,6 +35,9 @@
 #include <glib.h>
 
 #include "except.h"
+#ifdef KAZLIB_TEST_MAIN
+#include <wsutil/ws_printf.h> /* ws_debug_printf */
+#endif
 
 #ifdef _WIN32
 #include <windows.h>
@@ -180,7 +183,7 @@ static int match(const volatile except_id_t *thrown, const except_id_t *caught)
     return group_match && code_match;
 }
 
-G_GNUC_NORETURN WS_MSVC_NORETURN static void do_throw(except_t *except)
+WS_NORETURN static void do_throw(except_t *except)
 {
     struct except_stacknode *top;
 
@@ -216,11 +219,11 @@ G_GNUC_NORETURN WS_MSVC_NORETURN static void do_throw(except_t *except)
 static void unhandled_catcher(except_t *except)
 {
     if (except->except_message == NULL) {
-        fprintf(stderr, "Unhandled exception (group=%ld, code=%ld)\n",
+        fprintf(stderr, "Unhandled exception (group=%lu, code=%lu)\n",
                 except->except_id.except_group,
                 except->except_id.except_code);
     } else {
-        fprintf(stderr, "Unhandled exception (\"%s\", group=%ld, code=%ld)\n",
+        fprintf(stderr, "Unhandled exception (\"%s\", group=%lu, code=%lu)\n",
                 except->except_message, except->except_id.except_group,
                 except->except_id.except_code);
     }
@@ -261,7 +264,7 @@ struct except_stacknode *except_pop(void)
     return top;
 }
 
-G_GNUC_NORETURN WS_MSVC_NORETURN void except_rethrow(except_t *except)
+WS_NORETURN void except_rethrow(except_t *except)
 {
     struct except_stacknode *top = get_top();
     assert (top != 0);
@@ -271,7 +274,7 @@ G_GNUC_NORETURN WS_MSVC_NORETURN void except_rethrow(except_t *except)
     do_throw(except);
 }
 
-G_GNUC_NORETURN WS_MSVC_NORETURN void except_throw(long group, long code, const char *msg)
+WS_NORETURN void except_throw(long group, long code, const char *msg)
 {
     except_t except;
 
@@ -289,7 +292,7 @@ G_GNUC_NORETURN WS_MSVC_NORETURN void except_throw(long group, long code, const
     do_throw(&except);
 }
 
-G_GNUC_NORETURN WS_MSVC_NORETURN void except_throwd(long group, long code, const char *msg, void *data)
+WS_NORETURN void except_throwd(long group, long code, const char *msg, void *data)
 {
     except_t except;
 
@@ -306,7 +309,7 @@ G_GNUC_NORETURN WS_MSVC_NORETURN void except_throwd(long group, long code, const
  * XCEPT_BUFFER_SIZE?  We could then just use this to generate formatted
  * messages.
  */
-G_GNUC_NORETURN WS_MSVC_NORETURN void except_throwf(long group, long code, const char *fmt, ...)
+WS_NORETURN void except_throwf(long group, long code, const char *fmt, ...)
 {
     char *buf = (char *)except_alloc(XCEPT_BUFFER_SIZE);
     va_list vl;
@@ -381,13 +384,13 @@ void except_free(void *ptr)
 
 static void cleanup(void *arg)
 {
-    printf("cleanup(\"%s\") called\n", (char *) arg);
+    ws_debug_printf("cleanup(\"%s\") called\n", (char *) arg);
 }
 
 static void bottom_level(void)
 {
     char buf[256];
-    printf("throw exception? "); fflush(stdout);
+    ws_debug_printf("throw exception? "); fflush(stdout);
     fgets(buf, sizeof buf, stdin);
 
     if (buf[0] >= 0 && (buf[0] == 'Y' || buf[0] == 'y'))
@@ -422,10 +425,10 @@ int main(int argc, char **argv)
             /* inner catch */
             msg = except_message(ex);
             if (msg == NULL) {
-                printf("caught exception (inner): s=%ld, c=%ld\n",
+                ws_debug_printf("caught exception (inner): s=%lu, c=%lu\n",
                        except_group(ex), except_code(ex));
             } else {
-                printf("caught exception (inner): \"%s\", s=%ld, c=%ld\n",
+                ws_debug_printf("caught exception (inner): \"%s\", s=%lu, c=%lu\n",
                        msg, except_group(ex), except_code(ex));
             }
             except_rethrow(ex);
@@ -435,10 +438,10 @@ int main(int argc, char **argv)
         /* outer catch */
         msg = except_message(ex);
         if (msg == NULL) {
-            printf("caught exception (outer): s=%ld, c=%ld\n",
+            ws_debug_printf("caught exception (outer): s=%lu, c=%lu\n",
                    except_group(ex), except_code(ex));
         } else {
-            printf("caught exception (outer): \"%s\", s=%ld, c=%ld\n",
+            ws_debug_printf("caught exception (outer): \"%s\", s=%lu, c=%lu\n",
                    except_message(ex), except_group(ex), except_code(ex));
         }
     }