commit 575c40239c2a3a6ab31c4ed3b5072e5970cef5d2
Author: Jim Meyering <meyering(a)redhat.com>
Date: Thu Apr 28 08:25:39 2011 +0200
maint: use less syntax in #if directives (e.g., remove parentheses)
* backend.h: Use #ifndef _BACKEND_H rather than #if !defined(_BACKEND_H)
* iwh.h: Likewise.
* meta.cpp: Likewise.
* meta.h: Likewise.
* mpipe.h: Likewise.
* qlexer.l: Likewise.
* query.h: Likewise.
* replica.h: Likewise.
* rest.c: Likewise.
* setup.h: Likewise.
* state_defs.h: Likewise.
* template.h: Likewise.
backend.h | 2 +-
iwh.h | 2 +-
meta.cpp | 2 +-
meta.h | 6 +++---
mpipe.h | 2 +-
qlexer.l | 2 +-
query.h | 4 ++--
replica.h | 2 +-
rest.c | 2 +-
setup.h | 2 +-
state_defs.h | 2 +-
template.h | 2 +-
12 files changed, 15 insertions(+), 15 deletions(-)
---
diff --git a/backend.h b/backend.h
index 7edae08..3022500 100644
--- a/backend.h
+++ b/backend.h
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <
http://www.gnu.org/licenses/>. */
-#if !defined(_BACKEND_H)
+#ifndef _BACKEND_H
#define _BACKEND_H
#include "state_defs.h"
diff --git a/iwh.h b/iwh.h
index 565cf4f..853cde5 100644
--- a/iwh.h
+++ b/iwh.h
@@ -15,7 +15,7 @@
#define MY_PORT 9090
-#if defined(GLOBALS_IMPL)
+#ifdef GLOBALS_IMPL
#define GLOBAL(type,name,value) type name = value
#else
#define GLOBAL(type,name,value) extern type name
diff --git a/meta.cpp b/meta.cpp
index 298dd29..3cf6f57 100644
--- a/meta.cpp
+++ b/meta.cpp
@@ -46,7 +46,7 @@ using namespace mongo;
static pthread_mutex_t client_lock = PTHREAD_MUTEX_INITIALIZER;
-#if defined(SHOW_CONTENTION)
+#ifdef SHOW_CONTENTION
#define CLIENT_LOCK do { \
if (pthread_mutex_trylock(&client_lock) != 0) { \
cout << "contention in " << __func__ << endl; \
diff --git a/meta.h b/meta.h
index b620178..130b4b4 100644
--- a/meta.h
+++ b/meta.h
@@ -13,10 +13,10 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <
http://www.gnu.org/licenses/>. */
-#if !defined(_META_H)
+#ifndef _META_H
#define _META_H
-#if defined(__cplusplus)
+#ifdef __cplusplus
extern "C" {
#endif
@@ -42,7 +42,7 @@ void *meta_get_attrs (const char *bucket, const char *key);
int meta_attr_next (void *aobj, const char **, const char **);
void meta_attr_stop (void *aobj);
-#if defined(__cplusplus)
+#ifdef __cplusplus
}
#endif
diff --git a/mpipe.h b/mpipe.h
index 62edbaa..a36e439 100644
--- a/mpipe.h
+++ b/mpipe.h
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <
http://www.gnu.org/licenses/>. */
-#if !defined(_MPIPE_H)
+#ifndef _MPIPE_H
#define _MPIPE_H
#include <poll.h>
diff --git a/qlexer.l b/qlexer.l
index 8d64187..49d4cee 100644
--- a/qlexer.l
+++ b/qlexer.l
@@ -43,7 +43,7 @@
%%
-#if defined(UNIT_TEST)
+#ifdef UNIT_TEST
static void
yyerror (const char *msg)
{
diff --git a/query.h b/query.h
index 0b6352a..61dcd31 100644
--- a/query.h
+++ b/query.h
@@ -16,7 +16,7 @@
#ifndef _QUERY_H
#define _QUERY_H 1
-#if defined(__CPLUSPLUS__) || defined(__cplusplus)
+#if defined __CPLUSPLUS__ || defined __cplusplus
extern "C" {
#endif
@@ -83,7 +83,7 @@ void print_value (const value_t *);
value_t *parse (const char *text);
-#if defined(__CPLUSPLUS__) || defined(__cplusplus)
+#if defined __CPLUSPLUS__ || defined __cplusplus
}
#endif
diff --git a/replica.h b/replica.h
index 4dea07f..a489f1d 100644
--- a/replica.h
+++ b/replica.h
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <
http://www.gnu.org/licenses/>. */
-#if !defined(_REPLICA_H)
+#ifndef _REPLICA_H
#define _REPLICA_H
#include "state_defs.h"
diff --git a/rest.c b/rest.c
index f1055ad..0ec6a0f 100644
--- a/rest.c
+++ b/rest.c
@@ -57,7 +57,7 @@ const char version_etc_copyright[] =
year. */
"Copyright %s %d Red Hat, Inc.";
-#if defined(DEBUG)
+#ifdef DEBUG
#define MY_MHD_FLAGS MHD_USE_THREAD_PER_CONNECTION | MHD_USE_DEBUG
//#define MY_MHD_FLAGS MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG
#else
diff --git a/setup.h b/setup.h
index ca04931..bc6df77 100644
--- a/setup.h
+++ b/setup.h
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <
http://www.gnu.org/licenses/>. */
-#if !defined(_SETUP_H)
+#ifndef _SETUP_H
#define _SETUP_H
#include <curl/curl.h> /* needed by stuff in state_defs.h (from backend.h) */
diff --git a/state_defs.h b/state_defs.h
index 77163a4..6a3fd0b 100644
--- a/state_defs.h
+++ b/state_defs.h
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <
http://www.gnu.org/licenses/>. */
-#if !defined(_STATE_DEFS_H)
+#ifndef _STATE_DEFS_H
#define _STATE_DEFS_H
#include <microhttpd.h>
diff --git a/template.h b/template.h
index 4398a60..6603073 100644
--- a/template.h
+++ b/template.h
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <
http://www.gnu.org/licenses/>. */
-#if !defined(_TEMPLATE_H)
+#ifndef _TEMPLATE_H
#define _TEMPLATE_H
#define TMPL_BUF_SIZE 1024