Revision: 41067
http://brlcad.svn.sourceforge.net/brlcad/?rev=41067&view=rev
Author: brlcad
Date: 2010-10-19 00:11:47 +0000 (Tue, 19 Oct 2010)
Log Message:
-----------
LIKELY/UNLIKELY macros expect an integer argument, so compare against NULL
since that's what's implied. fixes strict build warning.
Modified Paths:
--------------
brlcad/trunk/src/libbu/avs.c
brlcad/trunk/src/libbu/fopen_uniq.c
brlcad/trunk/src/libbu/log.c
brlcad/trunk/src/libbu/malloc.c
brlcad/trunk/src/libbu/parse.c
Modified: brlcad/trunk/src/libbu/avs.c
===================================================================
--- brlcad/trunk/src/libbu/avs.c 2010-10-18 22:33:20 UTC (rev 41066)
+++ brlcad/trunk/src/libbu/avs.c 2010-10-19 00:11:47 UTC (rev 41067)
@@ -238,7 +238,7 @@
}
avsp->count = 0;
}
- if (LIKELY(avsp->avp)) {
+ if (LIKELY(avsp->avp != NULL)) {
bu_free((genptr_t)avsp->avp, "bu_avs_free avsp->avp");
avsp->avp = NULL; /* sanity */
avsp->max = 0;
@@ -274,9 +274,9 @@
BU_CK_AVS(avsp);
- /* don't even try */
- if (!name) {
- if (UNLIKELY(value)) {
+ /* nothing to do */
+ if (UNLIKELY(name == NULL)) {
+ if (UNLIKELY(value != NULL)) {
bu_log("WARNING: bu_avs_add_nonunique given NULL name and non-null
value\n");
}
return;
Modified: brlcad/trunk/src/libbu/fopen_uniq.c
===================================================================
--- brlcad/trunk/src/libbu/fopen_uniq.c 2010-10-18 22:33:20 UTC (rev 41066)
+++ brlcad/trunk/src/libbu/fopen_uniq.c 2010-10-19 00:11:47 UTC (rev 41067)
@@ -50,7 +50,7 @@
int fd;
FILE *fp;
- if (UNLIKELY(! namefmt || ! *namefmt))
+ if (UNLIKELY(!namefmt || !*namefmt))
bu_bomb("bu_uniq_file called with null string\n");
bu_semaphore_acquire(BU_SEM_SYSCALL);
@@ -70,7 +70,7 @@
fprintf(stderr, "%s", strerror(errno));
}
- if (LIKELY(outfmt))
+ if (LIKELY(outfmt != NULL))
fprintf(stderr, outfmt, filename);
bu_semaphore_release(BU_SEM_SYSCALL);
Modified: brlcad/trunk/src/libbu/log.c
===================================================================
--- brlcad/trunk/src/libbu/log.c 2010-10-18 22:33:20 UTC (rev 41066)
+++ brlcad/trunk/src/libbu/log.c 2010-10-19 00:11:47 UTC (rev 41067)
@@ -111,7 +111,7 @@
if (BU_LIST_IS_EMPTY(&(bu_log_hook_list.l))) {
- if (LIKELY(stderr)) {
+ if (LIKELY(stderr != NULL)) {
ret = fputc(c, stderr);
}
@@ -185,7 +185,7 @@
return;
}
- if (LIKELY(stderr)) {
+ if (LIKELY(stderr != NULL)) {
bu_semaphore_acquire(BU_SEM_SYSCALL);
ret = fwrite(bu_vls_addr(&output), len, 1, stderr);
fflush(stderr);
Modified: brlcad/trunk/src/libbu/malloc.c
===================================================================
--- brlcad/trunk/src/libbu/malloc.c 2010-10-18 22:33:20 UTC (rev 41066)
+++ brlcad/trunk/src/libbu/malloc.c 2010-10-19 00:11:47 UTC (rev 41067)
@@ -82,7 +82,7 @@
top:
bu_semaphore_acquire(BU_SEM_SYSCALL);
- if (LIKELY(bu_memdebug)) {
+ if (LIKELY(bu_memdebug != NULL)) {
mp = &bu_memdebug[bu_memdebug_len-1];
if (bu_memdebug_lowat > bu_memdebug
&& bu_memdebug_lowat < mp)
@@ -94,7 +94,7 @@
}
again:
- if (LIKELY(bu_memdebug)) {
+ if (LIKELY(bu_memdebug != NULL)) {
for (; mp >= bu_memdebug; mp--) {
/* Search for an empty slot */
if (mp->mdb_len > 0) continue;
Modified: brlcad/trunk/src/libbu/parse.c
===================================================================
--- brlcad/trunk/src/libbu/parse.c 2010-10-18 22:33:20 UTC (rev 41066)
+++ brlcad/trunk/src/libbu/parse.c 2010-10-19 00:11:47 UTC (rev 41067)
@@ -2151,7 +2151,7 @@
bu_free_external(register struct bu_external *ep)
{
BU_CK_EXTERNAL(ep);
- if (LIKELY(ep->ext_buf)) {
+ if (LIKELY(ep->ext_buf != NULL)) {
bu_free(ep->ext_buf, "bu_external ext_buf");
ep->ext_buf = GENPTR_NULL;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits