lkml.org 
[lkml]   [2010]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC/PATCH v6 02/12] media: Media device
On Thu, 25 Nov 2010 12:20:31 -0500
Andy Walls <awalls@md.metrocast.net> wrote:

> The signedness of char is ambiguous for 8 bit data, which is why an API would normally use u8 (or s8, I guess).
>
> Since this is known to be character data, I would think char would be fine. I am assuming C compilers would never assume multibyte "char"s.

char is 8bit in all modern C. I have used C compilers with configurable 9
or 7 bit char and such a machine is never going to run Linux without
serious insanity. Even grep in 9bit char is not fun...

The advantage of using u8 is that any casting goes the way you expect
whereas when working with UTF-8 things like

int x = name[0];

may not produce the expected result otherwise.

Alan


\
 
 \ /
  Last update: 2010-11-25 19:09    [W:0.020 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site