Changeset 663 for libcaca


Ignore:
Timestamp:
Mar 22, 2006, 6:30:56 PM (15 years ago)
Author:
Sam Hocevar
Message:
  • Removed code that did not need to be duplicated.
File:
1 edited

Legend:

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

    r644 r663  
    3131static void cucul_read_environment(cucul_t *);
    3232
    33 /** \brief Initialise \e libcucul.
     33/** \brief Initialise a \e libcucul canvas.
    3434 *
    3535 *  This function initialises internal \e libcucul structures and the backend
     
    4343{
    4444    cucul_t *qq = malloc(sizeof(cucul_t));
    45     int i;
    4645
    4746    cucul_read_environment(qq);
     
    5352     * default X11 window. When a graphic driver attaches to us, it can set
    5453     * a different size. */
    55     qq->width = 80;
    56     qq->height = 32;
    57 
    58     qq->chars = malloc(qq->width * qq->height * sizeof(uint32_t));
    59     qq->attr = malloc(qq->width * qq->height * sizeof(uint8_t));
    60 
    61     for(i = qq->width * qq->height; i--; )
    62         qq->chars[i] = (uint32_t)' ';
    63     memset(qq->attr, 0, qq->width * qq->height * sizeof(uint8_t));
    64 
    65     qq->empty_line = malloc(qq->width + 1);
    66     memset(qq->empty_line, ' ', qq->width);
    67     qq->empty_line[qq->width] = '\0';
    68 
    69     qq->scratch_line = malloc(qq->width + 1);
     54    qq->width = qq->width = 0;
     55    qq->chars = NULL;
     56    qq->attr = NULL;
     57    qq->empty_line = qq->scratch_line = NULL;
     58    _cucul_set_size(qq, 80, 32);
    7059
    7160    if(_cucul_init_bitmap())
Note: See TracChangeset for help on using the changeset viewer.