Эх сурвалжийг харах

StreamSocketSource: port to DebugError

ambrop7 15 жил өмнө
parent
commit
32ee730ed1

+ 3 - 16
flow/StreamSocketSource.c

@@ -26,16 +26,7 @@
 
 static void report_error (StreamSocketSource *s, int error)
 {
-    #ifndef NDEBUG
-    DEAD_ENTER(s->d_dead)
-    #endif
-    
-    FlowErrorReporter_ReportError(&s->rep, &error);
-    
-    #ifndef NDEBUG
-    ASSERT(DEAD_KILLED)
-    DEAD_LEAVE(s->d_dead);
-    #endif
+    DEBUGERROR(&s->d_err, FlowErrorReporter_ReportError(&s->rep, &error))
 }
 
 static void try_recv (StreamSocketSource *s)
@@ -109,16 +100,12 @@ void StreamSocketSource_Init (StreamSocketSource *s, FlowErrorReporter rep, BSoc
     s->out_avail = -1;
     
     DebugObject_Init(&s->d_obj);
-    #ifndef NDEBUG
-    DEAD_INIT(s->d_dead);
-    #endif
+    DebugError_Init(&s->d_err);
 }
 
 void StreamSocketSource_Free (StreamSocketSource *s)
 {
-    #ifndef NDEBUG
-    DEAD_KILL(s->d_dead);
-    #endif
+    DebugError_Free(&s->d_err);
     DebugObject_Free(&s->d_obj);
     
     // free output

+ 2 - 4
flow/StreamSocketSource.h

@@ -29,7 +29,7 @@
 
 #include <stdint.h>
 
-#include <misc/dead.h>
+#include <misc/debugerror.h>
 #include <system/DebugObject.h>
 #include <system/BSocket.h>
 #include <flow/StreamRecvInterface.h>
@@ -48,9 +48,7 @@ typedef struct {
     int out_avail;
     uint8_t *out;
     DebugObject d_obj;
-    #ifndef NDEBUG
-    dead_t d_dead;
-    #endif
+    DebugError d_err;
 } StreamSocketSource;
 
 /**