Skip to Content.
Sympa Menu

freetds - Re: element of style

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Brian Bruns <camber AT ais.org>
  • To: TDS Development Group <freetds AT franklin.metalab.unc.edu>
  • Subject: Re: element of style
  • Date: Sat, 24 Aug 2002 07:26:46 -0400 (EDT)


On 24 Aug 2002, Frediano Ziglio wrote:

> Il sab, 2002-08-24 alle 09:09, James K.Lowden ha scritto:
> > Contributors,
> >
> > There are several places in e.g. tds/convert.c that use comparisons to
> > very strange decimal numbers. I'd like to see us use hex instead, when
> > we're looking for overflow conditions and such.
>
> Sound right..
> Perhaps should best to add a CodingStyle document to FreeTDS...

http://www.freetds.org/CodingStyle

Addtions and corrections are welcome.

> I know that { should be placed after while/if/switch/for (exception for
> functions/struct). But case should be indented from switch or not?
> Should we use tab or space (how many?) to indent?
>

> INT_16_MAX is quite different from INT_MAX. We don't know INT_MAX in
> every platform but INT_16_MAX is always 0x8000...
> The only problem should be INT_64_MAX... is 0x8000000000000000l or
> 0x8000000000000000ll or 0x8000000000000000i64 ?
> There are some defines in inttypes.h to handle this stuff...
> Perhaps is better to define because is easy to forgot a zero...

inttypes.h is not extremely portable. We should handle this in autoconf
or simply assign the values once in tds.h

> > because by relying on the system header files, we avoid bumping into
> > compiler corner cases, valid expressions that some compilers will fail to
> > comprehend.
> >
> > --jkl
> >
> freddy77
>





Archive powered by MHonArc 2.6.24.

Top of Page