diff --git a/caca/caca.h b/caca/caca.h index 6f48334..9364af0 100644 --- a/caca/caca.h +++ b/caca/caca.h @@ -218,8 +218,8 @@ __extern int caca_unmanage_canvas(caca_canvas_t *, int (*)(void *), void *); __extern int caca_set_canvas_size(caca_canvas_t *, int, int); __extern int caca_get_canvas_width(caca_canvas_t const *); __extern int caca_get_canvas_height(caca_canvas_t const *); -__extern uint8_t const * caca_get_canvas_chars(caca_canvas_t const *); -__extern uint8_t const * caca_get_canvas_attrs(caca_canvas_t const *); +__extern uint32_t const * caca_get_canvas_chars(caca_canvas_t const *); +__extern uint32_t const * caca_get_canvas_attrs(caca_canvas_t const *); __extern int caca_free_canvas(caca_canvas_t *); __extern int caca_rand(int, int); __extern char const * caca_get_version(void); diff --git a/caca/canvas.c b/caca/canvas.c index 0c171c7..a01cb3c 100644 --- a/caca/canvas.c +++ b/caca/canvas.c @@ -263,17 +263,17 @@ int caca_get_canvas_height(caca_canvas_t const *cv) * consist in native endian 32-bit Unicode values as returned by * caca_get_char(). * - * This function is only useful for display drivers such as the \e libcaca - * library. + * This function is probably only useful for \e libcaca 's internal display + * drivers. * * This function never fails. * * \param cv A libcaca canvas. * \return The canvas character array. */ -uint8_t const * caca_get_canvas_chars(caca_canvas_t const *cv) +uint32_t const * caca_get_canvas_chars(caca_canvas_t const *cv) { - return (uint8_t const *)cv->chars; + return (uint32_t const *)cv->chars; } /** \brief Get the canvas attribute array. @@ -282,17 +282,17 @@ uint8_t const * caca_get_canvas_chars(caca_canvas_t const *cv) * consist in native endian 32-bit attribute values as returned by * caca_get_attr(). * - * This function is only useful for display drivers such as the \e libcaca - * library. + * This function is probably only useful for \e libcaca 's internal display + * drivers. * * This function never fails. * * \param cv A libcaca canvas. * \return The canvas attribute array. */ -uint8_t const * caca_get_canvas_attrs(caca_canvas_t const *cv) +uint32_t const * caca_get_canvas_attrs(caca_canvas_t const *cv) { - return (uint8_t const *)cv->attrs; + return (uint32_t const *)cv->attrs; } /** \brief Free a \e libcaca canvas. @@ -539,9 +539,9 @@ int cucul_get_canvas_width(cucul_canvas_t const *) CACA_ALIAS(caca_get_canvas_width); int cucul_get_canvas_height(cucul_canvas_t const *) CACA_ALIAS(caca_get_canvas_height); -uint8_t const * cucul_get_canvas_chars(cucul_canvas_t const *) +uint32_t const * cucul_get_canvas_chars(cucul_canvas_t const *) CACA_ALIAS(caca_get_canvas_chars); -uint8_t const * cucul_get_canvas_attrs(cucul_canvas_t const *) +uint32_t const * cucul_get_canvas_attrs(cucul_canvas_t const *) CACA_ALIAS(caca_get_canvas_attrs); int cucul_free_canvas(cucul_canvas_t *) CACA_ALIAS(caca_free_canvas); int cucul_rand(int, int) CACA_ALIAS(caca_rand); diff --git a/caca/driver/conio.c b/caca/driver/conio.c index e429273..11a43ee 100644 --- a/caca/driver/conio.c +++ b/caca/driver/conio.c @@ -1,6 +1,6 @@ /* * libcaca Colour ASCII-Art library - * Copyright (c) 2002-2006 Sam Hocevar + * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * * $Id$ @@ -98,8 +98,8 @@ static int conio_get_display_height(caca_display_t const *dp) static void conio_display(caca_display_t *dp) { char *screen = dp->drv.p->screen; - uint32_t const *chars = (uint32_t const *)caca_get_canvas_chars(dp->cv); - uint32_t const *attrs = (uint32_t const *)caca_get_canvas_attrs(dp->cv); + uint32_t const *chars = caca_get_canvas_chars(dp->cv); + uint32_t const *attrs = caca_get_canvas_attrs(dp->cv); int width = caca_get_canvas_width(dp->cv); int height = caca_get_canvas_height(dp->cv); int n; diff --git a/caca/driver/gl.c b/caca/driver/gl.c index 6c0aca2..3d6440a 100644 --- a/caca/driver/gl.c +++ b/caca/driver/gl.c @@ -1,6 +1,6 @@ /* * libcaca Colour ASCII-Art library - * Copyright (c) 2002-2006 Sam Hocevar + * Copyright (c) 2002-2009 Sam Hocevar * 2006 Jean-Yves Lamoureux * 2007 Ben Wiley Sittler * All Rights Reserved @@ -216,8 +216,8 @@ static int gl_get_display_height(caca_display_t const *dp) static void gl_display(caca_display_t *dp) { - uint32_t const *cvchars = (uint32_t const *)caca_get_canvas_chars(dp->cv); - uint32_t const *cvattrs = (uint32_t const *)caca_get_canvas_attrs(dp->cv); + uint32_t const *cvchars = caca_get_canvas_chars(dp->cv); + uint32_t const *cvattrs = caca_get_canvas_attrs(dp->cv); int width = caca_get_canvas_width(dp->cv); int x, y, line; diff --git a/caca/driver/ncurses.c b/caca/driver/ncurses.c index 8741830..53053b3 100644 --- a/caca/driver/ncurses.c +++ b/caca/driver/ncurses.c @@ -355,10 +355,8 @@ static void ncurses_display(caca_display_t *dp) caca_get_dirty_rect(dp->cv, i, &dx, &dy, &dw, &dh); - cvchars = (uint32_t const *)caca_get_canvas_chars(dp->cv) - + dx + dy * dp->cv->width; - cvattrs = (uint32_t const *)caca_get_canvas_attrs(dp->cv) - + dx + dy * dp->cv->width; + cvchars = caca_get_canvas_chars(dp->cv) + dx + dy * dp->cv->width; + cvattrs = caca_get_canvas_attrs(dp->cv) + dx + dy * dp->cv->width; for(y = dy; y < dy + dh; y++) { diff --git a/caca/driver/slang.c b/caca/driver/slang.c index c6c1971..b2849fd 100644 --- a/caca/driver/slang.c +++ b/caca/driver/slang.c @@ -244,10 +244,8 @@ static void slang_display(caca_display_t *dp) caca_get_dirty_rect(dp->cv, i, &dx, &dy, &dw, &dh); - cvchars = (uint32_t const *)caca_get_canvas_chars(dp->cv) - + dx + dy * dp->cv->width; - cvattrs = (uint32_t const *)caca_get_canvas_attrs(dp->cv) - + dx + dy * dp->cv->width; + cvchars = caca_get_canvas_chars(dp->cv) + dx + dy * dp->cv->width; + cvattrs = caca_get_canvas_attrs(dp->cv) + dx + dy * dp->cv->width; for(y = dy; y < dy + dh; y++) { diff --git a/caca/driver/vga.c b/caca/driver/vga.c index b53e963..8552954 100644 --- a/caca/driver/vga.c +++ b/caca/driver/vga.c @@ -124,10 +124,8 @@ static void vga_display(caca_display_t *dp) caca_get_dirty_rect(dp->cv, i, &dx, &dy, &dw, &dh); - cvchars = (uint32_t const *)caca_get_canvas_chars(dp->cv) - + dx + dy * dp->cv->width; - cvattrs = (uint32_t const *)caca_get_canvas_attrs(dp->cv) - + dx + dy * dp->cv->width; + cvchars = caca_get_canvas_chars(dp->cv) + dx + dy * dp->cv->width; + cvattrs = caca_get_canvas_attrs(dp->cv) + dx + dy * dp->cv->width; screen += dy * dp->cv->width + dx; diff --git a/caca/driver/win32.c b/caca/driver/win32.c index da67ee3..923294a 100644 --- a/caca/driver/win32.c +++ b/caca/driver/win32.c @@ -195,8 +195,8 @@ static void win32_display(caca_display_t *dp) COORD size, pos; SMALL_RECT rect; CHAR_INFO *buffer = dp->drv.p->buffer; - uint32_t const *cvchars = (uint32_t const *)caca_get_canvas_chars(dp->cv); - uint32_t const *cvattrs = (uint32_t const *)caca_get_canvas_attrs(dp->cv); + uint32_t const *cvchars = caca_get_canvas_chars(dp->cv); + uint32_t const *cvattrs = caca_get_canvas_attrs(dp->cv); int width = caca_get_canvas_width(dp->cv); int height = caca_get_canvas_height(dp->cv); int n; diff --git a/caca/driver/x11.c b/caca/driver/x11.c index f41b0a5..f81b2ce 100644 --- a/caca/driver/x11.c +++ b/caca/driver/x11.c @@ -393,8 +393,8 @@ static int x11_get_display_height(caca_display_t const *dp) static void x11_display(caca_display_t *dp) { - uint32_t const *cvchars = (uint32_t const *)caca_get_canvas_chars(dp->cv); - uint32_t const *cvattrs = (uint32_t const *)caca_get_canvas_attrs(dp->cv); + uint32_t const *cvchars = caca_get_canvas_chars(dp->cv); + uint32_t const *cvattrs = caca_get_canvas_attrs(dp->cv); int width = caca_get_canvas_width(dp->cv); int height = caca_get_canvas_height(dp->cv); int x, y, i, len;