projects
/
profile
/
ivi
/
syslinux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eb1cb64
)
refstr_get(): handle NULL, force inline
author
H. Peter Anvin
<hpa@zytor.com>
Tue, 19 Feb 2008 22:08:06 +0000
(14:08 -0800)
committer
H. Peter Anvin
<hpa@zytor.com>
Wed, 20 Feb 2008 00:51:23 +0000
(16:51 -0800)
Make refstr_get() handle NULL correctly; force it to be an inline
since it seems to make no difference for code size.
com32/menu/refstr.h
patch
|
blob
|
history
diff --git
a/com32/menu/refstr.h
b/com32/menu/refstr.h
index
593b0ab
..
8bec018
100644
(file)
--- a/
com32/menu/refstr.h
+++ b/
com32/menu/refstr.h
@@
-22,10
+22,11
@@
#include <stddef.h>
#include <stdarg.h>
-static inline const char *refstr_get(const char *r)
+static inline __attribute__((always_inline))
+const char *refstr_get(const char *r)
{
- unsigned int *ref = (unsigned int *)r - 1;
-
ref
++;
+ if (r)
+
((unsigned int *)r)[-1]
++;
return r;
}