[Freeciv-Dev] Re: PATCH: load_map_data macro (PR#1012)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sun, Oct 14, 2001 at 10:45:21PM -0400, Jason Dorje Short wrote:
> Raimar Falke wrote:
> >
> > On Sat, Oct 13, 2001 at 04:36:08PM -0700, jdorje@xxxxxxxxxxxxxxxxxxxxx
> > wrote:
> > > The attached patch implements a LOAD_MAP_POS macro. It then makes code
> > > replacement like replacing
>
> > > +static const char dec2hex[] = "0123456789abcdef";
> >
> > hex2dec and dec2hex may not be the best names. What about print_hex
> > and scan_hex (parse_hex)? These method are just short and much more
> > faster versions of sprintf and sscanf.
>
> hex2dec and dec2hex as they are now are correctly named, I think. They
> don't compare to sprintf and sscanf; they convert a hex to/from a
> character rather than a string. Or perhaps I don't quite understand
> what you're saying?
dec2hex is wrong. It isn't the converting between two number systems
but rather a binary2ascii_hex. One side of the convertion is a
hex string/char and the other is a number in the internal
representation of the computer. This internal number doesn't have a
number system. It isn't decimal.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
+#if defined(__alpha__) && defined(CONFIG_PCI)
+ /*
+ * The meaning of life, the universe, and everything. Plus
+ * this makes the year come out right.
+ */
+ year -= 42;
+#endif
-- Patch for 1.3.2 (kernel/time.c) from Marcus Meissner
|
|