maint: avoid excess parens in STREQ

* src/internal.h (STREQ, STRCASEEQ, STRNEQ, STRCASENEQ, STREQLEN)
(STRCASEEQLEN, STRNEQLEN, STRCASENEQLEN, STRPREFIX): Avoid
redundant parenthesis.
* examples/domain-events/events-c/event-test.c (STREQ): Likewise.
* src/storage/parthelper.c (STREQ): Likewise.
This commit is contained in:
Eric Blake 2010-01-27 06:59:02 -07:00 committed by Jim Meyering
parent 1e44c678fa
commit 6b8d8395b6
3 changed files with 12 additions and 12 deletions

View File

@ -14,7 +14,7 @@
__func__, __LINE__)
#define DEBUG(fmt, ...) printf("%s:%d: " fmt "\n", \
__func__, __LINE__, __VA_ARGS__)
#define STREQ(a,b) (strcmp((a),(b)) == 0)
#define STREQ(a,b) (strcmp(a,b) == 0)
#ifndef ATTRIBUTE_UNUSED
#define ATTRIBUTE_UNUSED __attribute__((__unused__))

View File

@ -48,15 +48,15 @@
#define N_(str) dgettext(GETTEXT_PACKAGE, (str))
/* String equality tests, suggested by Jim Meyering. */
#define STREQ(a,b) (strcmp((a),(b)) == 0)
#define STRCASEEQ(a,b) (strcasecmp((a),(b)) == 0)
#define STRNEQ(a,b) (strcmp((a),(b)) != 0)
#define STRCASENEQ(a,b) (strcasecmp((a),(b)) != 0)
#define STREQLEN(a,b,n) (strncmp((a),(b),(n)) == 0)
#define STRCASEEQLEN(a,b,n) (strncasecmp((a),(b),(n)) == 0)
#define STRNEQLEN(a,b,n) (strncmp((a),(b),(n)) != 0)
#define STRCASENEQLEN(a,b,n) (strncasecmp((a),(b),(n)) != 0)
#define STRPREFIX(a,b) (strncmp((a),(b),strlen((b))) == 0)
#define STREQ(a,b) (strcmp(a,b) == 0)
#define STRCASEEQ(a,b) (strcasecmp(a,b) == 0)
#define STRNEQ(a,b) (strcmp(a,b) != 0)
#define STRCASENEQ(a,b) (strcasecmp(a,b) != 0)
#define STREQLEN(a,b,n) (strncmp(a,b,n) == 0)
#define STRCASEEQLEN(a,b,n) (strncasecmp(a,b,n) == 0)
#define STRNEQLEN(a,b,n) (strncmp(a,b,n) != 0)
#define STRCASENEQLEN(a,b,n) (strncasecmp(a,b,n) != 0)
#define STRPREFIX(a,b) (strncmp(a,b,strlen(b)) == 0)
#define NUL_TERMINATE(buf) do { (buf)[sizeof(buf)-1] = '\0'; } while (0)
#define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array))

View File

@ -10,7 +10,7 @@
* in a reliable fashion if merely after a list of partitions & sizes,
* though it is fine for creating partitions.
*
* Copyright (C) 2007-2008 Red Hat, Inc.
* Copyright (C) 2007-2008, 2010 Red Hat, Inc.
* Copyright (C) 2007-2008 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@ -37,7 +37,7 @@
#include <string.h>
/* we don't need to include the full internal.h just for this */
#define STREQ(a,b) (strcmp((a),(b)) == 0)
#define STREQ(a,b) (strcmp(a,b) == 0)
/* Make the comparisons below fail if your parted headers
are so old that they lack the definition. */