Messages in this thread | | | From | Jakob Kemi <> | Subject | Re: [PATCH] hex <-> int conversion routines. | Date | Tue, 19 Feb 2002 19:49:32 +0100 |
| |
> > +static __inline__ int _hexint_byte(const char *src) > > +{ > > ... > > > +} > > Not worth inlining. char conversion are seldomly time critical. ok, I removed the inline version.
> > +static __inline__ int hexint_nibble(char x) > > Same applies here. I added a tiny function, __hexint_nibble() which doesn't do error checking. it's very small and can be used inline if needed.
> > +static __inline__ char inthex_nibble(int x) > > +{ > > + const char* digits = "0123456789abcdef"; > > + > > + return digits[x & 0x0f]; > > +} > > perhaps better do static const char *digits. GCC doesn't copy const strings, as opposed to other const arrays. So it should be fine as it is. GCC also reuse duplicated strings.
Regards, Jakob Kemi - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |