summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2010-08-18 18:53:44 +0300
committerTimo Teräs <timo.teras@iki.fi>2010-08-18 18:53:44 +0300
commitcf8d9e12f5222e5e6173a82f58c14b7eb6842c46 (patch)
treee242bfb84e4dca79e3e0cacf18c498d8d5812772
parent74d0daba0a9ffeacc83b3e7361c30e4b0b24c5af (diff)
downloadsquark-cf8d9e12f5222e5e6173a82f58c14b7eb6842c46.tar.bz2
squark-cf8d9e12f5222e5e6173a82f58c14b7eb6842c46.tar.xz
blob: definite null blob inline
Should be faster in most cases to write two null words than to copy them around.
-rw-r--r--blob.c1
-rw-r--r--blob.h3
2 files changed, 1 insertions, 3 deletions
diff --git a/blob.c b/blob.c
index 5a3b226..81722d2 100644
--- a/blob.c
+++ b/blob.c
@@ -1,6 +1,5 @@
#include "blob.h"
-const blob_t BLOB_NULL = { NULL, 0 };
static const char *xd = "0123456789abcdefghijklmnopqrstuvwxyz";
static inline int dx(int c)
diff --git a/blob.h b/blob.h
index dba2f97..cfd8cd5 100644
--- a/blob.h
+++ b/blob.h
@@ -28,8 +28,7 @@ typedef struct blob {
#define BLOB_STRLEN(str) (blob_t){(str), strlen(str)}
#define BLOB_STR_INIT(str) {(str), sizeof(str)-1}
#define BLOB_STR(str) (blob_t) BLOB_STR_INIT(str)
-
-extern const blob_t BLOB_NULL;
+#define BLOB_NULL (blob_t){NULL, 0}
static inline int blob_is_null(blob_t b)
{