Changeset 1307 for libcaca/trunk


Ignore:
Timestamp:
Nov 8, 2006, 6:18:23 PM (16 years ago)
Author:
Sam Hocevar
Message:
  • Set the cucul_import_memory() buffer type to void const * instead of unsigned char const * so that C++ programs won't complain.

_ _ _ _

/ _ \| \/ |/ _| / _ \ / _ \ / _ \

| | | | |\/| | | _ | (_) | (_) | (_) |
| |_| | | | | |_| | \, |\, |\, |

\_/|_| |_|\| /_/ /_/ /_/

Location:
libcaca/trunk/cucul
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/cucul/cucul.h

    r1306 r1307  
    217217 *
    218218 *  @{ */
    219 long int cucul_import_memory(cucul_canvas_t *, unsigned char const *,
     219long int cucul_import_memory(cucul_canvas_t *, void const *,
    220220                             unsigned long int, char const *);
    221221long int cucul_import_file(cucul_canvas_t *, char const *, char const *);
  • libcaca/trunk/cucul/import.c

    r1305 r1307  
    8383 *  \return The number of bytes read, or -1 if an error occurred.
    8484 */
    85 long int cucul_import_memory(cucul_canvas_t *cv, unsigned char const *buf,
     85long int cucul_import_memory(cucul_canvas_t *cv, void const *buf,
    8686                             unsigned long int len, char const *format)
    8787{
     
    9898    if(!strcasecmp("", format))
    9999    {
     100        unsigned char const *str = buf;
    100101        unsigned int i;
    101102
    102103        /* If 4 first bytes are 0xcaca + 'CV' */
    103         if(len >= 4 && buf[0] == 0xca &&
    104            buf[1] == 0xca && buf[2] == 'C' && buf[3] == 'V')
     104        if(len >= 4 && str[0] == 0xca &&
     105           str[1] == 0xca && str[2] == 'C' && str[3] == 'V')
    105106            return import_caca(cv, buf, len);
    106107
    107108        /* If we find ESC[ argv, we guess it's an ANSI file */
    108109        for(i = 0; i + 1 < len; i++)
    109             if((buf[i] == 0x1b) && (buf[i + 1] == '['))
     110            if((str[i] == 0x1b) && (str[i + 1] == '['))
    110111                return import_ansi(cv, buf, len, 0);
    111112
Note: See TracChangeset for help on using the changeset viewer.