Permalink
Browse files

allow use of the DDEBUG macro from the outside (via the "-D DDEBUG=1"…

… cc opton).
  • Loading branch information...
1 parent 290d6cb commit e6a54aba197a4fbab5687dbfaf1fd39213424c26 @agentzh agentzh committed Jan 17, 2012
@@ -1,4 +1,6 @@
+#ifndef DDEBUG
#define DDEBUG 0
+#endif
#include "ddebug.h"
#include <ndk.h>
@@ -30,7 +32,7 @@ ngx_http_set_misc_encode_base32(ngx_http_request_t *r,
len = base32_encoded_length(v->len);
- dd("estimated dst len: %d", len);
+ dd("estimated dst len: %d", (int) len);
p = ngx_palloc(r->pool, len);
if (p == NULL) {
@@ -44,7 +46,7 @@ ngx_http_set_misc_encode_base32(ngx_http_request_t *r,
res->data = p;
res->len = len;
- dd("res (len %d): %.*s", res->len, res->len, res->data);
+ dd("res (len %d): %.*s", (int) res->len, (int) res->len, res->data);
return NGX_OK;
}
@@ -61,7 +63,7 @@ ngx_http_set_misc_decode_base32(ngx_http_request_t *r,
len = base32_decoded_length(v->len);
- dd("estimated dst len: %d", len);
+ dd("estimated dst len: %d", (int) len);
p = ngx_palloc(r->pool, len);
if (p == NULL) {
@@ -1,4 +1,6 @@
+#ifndef DDEBUG
#define DDEBUG 0
+#endif
#include "ddebug.h"
#include <ndk.h>
@@ -1,5 +1,8 @@
+#ifndef DDEBUG
#define DDEBUG 0
+#endif
#include "ddebug.h"
+
#include <ndk.h>
#include "ngx_http_set_default_value.h"
@@ -1,5 +1,8 @@
+#ifndef DDEBUG
#define DDEBUG 0
+#endif
#include "ddebug.h"
+
#include <ndk.h>
#include "ngx_http_set_escape_uri.h"
#include "ngx_string.h"
@@ -48,7 +51,7 @@ ngx_http_set_misc_escape_uri(ngx_http_request_t *r,
res->data = dst;
res->len = len;
- dd("after eacape:%.*s", res->len, res->data);
+ dd("after eacape:%.*s", (int) res->len, res->data);
return NGX_OK;
}
View
@@ -1,4 +1,6 @@
+#ifndef DDEBUG
#define DDEBUG 0
+#endif
#include "ddebug.h"
#include "ngx_http_set_hash.h"
@@ -40,7 +40,7 @@ ngx_http_set_misc_set_hashed_upstream(ngx_http_request_t *r,
ulname.data = v->data;
ulname.len = v->len;
- dd("ulname: %.*s", ulname.len, ulname.data);
+ dd("ulname: %.*s", (int) ulname.len, ulname.data);
ul = ndk_get_upstream_list(ndk_http_get_main_conf(r),
ulname.data, ulname.len);
@@ -66,7 +66,7 @@ ngx_http_set_misc_set_hashed_upstream(ngx_http_request_t *r,
u = ul->elts;
- dd("upstream list: %d upstreams found", ul->nelts);
+ dd("upstream list: %d upstreams found", (int) ul->nelts);
if (ul->nelts == 1) {
dd("only one upstream found in the list");
View
@@ -1,7 +1,9 @@
+#ifndef DDEBUG
#define DDEBUG 0
+#endif
#include "ddebug.h"
-#include <ndk.h>
+#include <ndk.h>
#include "ngx_http_set_hex.h"
ngx_int_t
@@ -1,4 +1,6 @@
+#ifndef DDEBUG
#define DDEBUG 0
+#endif
#include "ddebug.h"
#include <ndk.h>
@@ -1,4 +1,6 @@
+#ifndef DDEBUG
#define DDEBUG 0
+#endif
#include "ddebug.h"
#include <ndk.h>
@@ -1,5 +1,8 @@
+#ifndef DDEBUG
#define DDEBUG 0
+#endif
#include "ddebug.h"
+
#include <ndk.h>
#include "ngx_http_set_quote_json.h"
@@ -1,6 +1,8 @@
+#ifndef DDEBUG
#define DDEBUG 0
-
+#endif
#include "ddebug.h"
+
#include <ndk.h>
#include "ngx_http_set_quote_sql.h"
@@ -1,7 +1,9 @@
+#ifndef DDEBUG
#define DDEBUG 0
+#endif
#include "ddebug.h"
-#include <ndk.h>
+#include <ndk.h>
#include "ngx_http_set_random.h"
#include <stdlib.h>
@@ -1,5 +1,8 @@
+#ifndef DDEBUG
#define DDEBUG 0
+#endif
#include "ddebug.h"
+
#include <ndk.h>
#include "ngx_http_set_unescape_uri.h"

0 comments on commit e6a54ab

Please sign in to comment.