Просмотр исходного кода

PRStreamSource: port to DebugError

ambrop7 15 лет назад
Родитель
Сommit
502b77d1b8
2 измененных файлов с 5 добавлено и 20 удалено
  1. 3 16
      nspr_support/PRStreamSource.c
  2. 2 4
      nspr_support/PRStreamSource.h

+ 3 - 16
nspr_support/PRStreamSource.c

@@ -28,16 +28,7 @@
 
 static void report_error (PRStreamSource *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 (PRStreamSource *s)
@@ -109,16 +100,12 @@ void PRStreamSource_Init (PRStreamSource *s, FlowErrorReporter rep, BPRFileDesc
     s->out_avail = -1;
     
     DebugObject_Init(&s->d_obj);
-    #ifndef NDEBUG
-    DEAD_INIT(s->d_dead);
-    #endif
+    DebugError_Init(&s->d_err);
 }
 
 void PRStreamSource_Free (PRStreamSource *s)
 {
-    #ifndef NDEBUG
-    DEAD_KILL(s->d_dead);
-    #endif
+    DebugError_Free(&s->d_err);
     DebugObject_Free(&s->d_obj);
     
     // free output

+ 2 - 4
nspr_support/PRStreamSource.h

@@ -29,7 +29,7 @@
 
 #include <stdint.h>
 
-#include <misc/dead.h>
+#include <misc/debugerror.h>
 #include <system/DebugObject.h>
 #include <flow/StreamRecvInterface.h>
 #include <flow/FlowError.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;
 } PRStreamSource;
 
 /**