pike.git / src / modules / Image / font.c

version» Context lines:

pike.git/src/modules/Image/font.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: font.c,v 1.91 2008/05/04 00:34:22 nilsson Exp $ + || $Id: font.c,v 1.92 2010/07/27 16:46:05 mast Exp $   */      #include "global.h"      #define SPACE_CHAR 'i'      extern const unsigned char image_default_font[];   #define IMAGE_DEFAULT_FONT_SIZE 30596      
pike.git/src/modules/Image/font.c:303:    unsigned INT32 version;    unsigned INT32 chars;    unsigned INT32 height;    unsigned INT32 baseline;    unsigned INT32 o[1];    } *fh = NULL;   #ifdef HAVE_MMAP    size_t mmaped_size = 0;   #endif    size_t size = 0; -  char *filename; +  char *filename = NULL;       get_all_args("Image.Font->load()", args, ".%s", &filename);    -  if (!args) +  if (!filename)    {    fh = (struct file_head *)image_default_font;    size = IMAGE_DEFAULT_FONT_SIZE;    } else {    int fd = -1;       do    {   #ifdef FONT_DEBUG    fprintf(stderr,"FONT open '%s'\n",sp[-args].u.string->str);
pike.git/src/modules/Image/font.c:401: Inside #if defined(FONT_DEBUG)
     #ifdef FONT_DEBUG    fprintf(stderr,"FONT version 1\n");   #endif       num_chars = ntohl(fh->chars);       new_font=malloc(sizeof(struct font)+    sizeof(struct _char)*(num_chars-1));    if(!new_font) { -  if (args) { +  if (filename) {   #ifdef HAVE_MMAP    if (mmaped_size)    munmap((void *)fh, mmaped_size);    else   #endif    free(fh);    }    SIMPLE_OUT_OF_MEMORY_ERROR(0,0);    }   
pike.git/src/modules/Image/font.c:463:   #endif    return;    } /* wrong version */   #ifdef FONT_DEBUG    else fprintf(stderr,"FONT unknown version\n");   #endif    } /* wrong cookie */   #ifdef FONT_DEBUG    else fprintf(stderr,"FONT wrong cookie\n");   #endif -  if (args) { +  if (filename) {   #ifdef HAVE_MMAP    if (mmaped_size)    munmap((void *)fh, mmaped_size);    else   #endif    free(fh);    }    } /* mem failure */   #ifdef FONT_DEBUG    else fprintf(stderr,"FONT mem failure\n");