Bug 40020

Summary: Add support for apr_uint8_t and apr_int8_t types
Product: APR Reporter: Mike Duigou <bondolo>
Component: APRAssignee: Apache Portable Runtime bugs mailinglist <bugs>
Status: NEW ---    
Severity: enhancement Keywords: PatchAvailable
Priority: P3    
Version: HEAD   
Target Milestone: ---   
Hardware: Other   
OS: All   
Attachments: adds support for uint8 and int8 types to apr.h

Description Mike Duigou 2006-07-11 20:28:49 UTC
A patch to add apr_uint8_t and apr_int8_t to apr.h is attached. It also ensures
that CHAR_BIT is 8 bits (it normally is) and that short_value and long_value are
defined.
Comment 1 Mike Duigou 2006-07-11 20:29:54 UTC
Created attachment 18589 [details]
adds support for uint8 and int8 types to apr.h
Comment 2 William A. Rowe Jr. 2007-05-31 23:38:18 UTC
since this falls into 1.3.x - it falls into the enhancement category.
Comment 3 Joe Orton 2007-07-04 03:06:58 UTC
Why not use "unsigned char" and "signed char"? 
Comment 4 Mike Duigou 2007-07-09 10:37:53 UTC
For the same reason that uint32 and int32 is used rather than unsigned int or
signed int--the size of "char" is not fixed. 

Admittedly char is almost always 8 bits except for some obscure embedded OSes
that are used Asia (native 16 bit chars) and are not likely targets for APR.

Using only the uint* and int* types for wire protocols has a nice symmetry and
specificness as well. ie.

struct foo {
  int8  version;
  uint8 type;
  int16 thing;
  uint16 length;
  int32 signature;
  uint32 control;
  int64 offset;
  uint64 time;
};