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

version» Context lines:

pike.git/src/modules/Image/font.c:1: - /* $Id: font.c,v 1.44 1999/04/13 12:32:20 mirar Exp $ */ + /* $Id: font.c,v 1.45 1999/04/25 19:58:22 grubba Exp $ */   #include "global.h"   #include <config.h>      #define SPACE_CHAR 'i'      /*   **! module Image   **! note - **! $Id: font.c,v 1.44 1999/04/13 12:32:20 mirar Exp $ + **! $Id: font.c,v 1.45 1999/04/25 19:58:22 grubba Exp $   **! class Font   **!   **! note   **! Short technical documentation on a font file:   **! This object adds the text-drawing and -creation   **! capabilities of the <ref>Image</ref> module.   **!   **! For simple usage, see   **! <ref>write</ref> and <ref>load</ref>.   **!
pike.git/src/modules/Image/font.c:275: Inside #if undefined(HAVE_MMAP)
   return 0;    }    }    return res;   }   #endif      static INLINE long file_size(int fd)   {    struct stat tmp; -  int res; +     if((!fd_fstat(fd, &tmp)) &&    (tmp.st_mode & S_IFREG)) -  return res = tmp.st_size; +  return (long)tmp.st_size;    return -1;   }      static INLINE void write_char(struct _char *ci,    rgb_group *pos,    INT32 xsize,    INT32 height)   {    rgb_group *nl;    INT32 x,y;
pike.git/src/modules/Image/font.c:359:    do    {   #ifdef FONT_DEBUG    fprintf(stderr,"FONT open '%s'\n",sp[-args].u.string->str);   #endif    fd = fd_open(sp[-args].u.string->str,fd_RDONLY,0);    } while(fd < 0 && errno == EINTR);       if (fd >= 0)    { -  long size; +  size_t size;    struct font *new_font;    -  size = file_size(fd); +  size = (size_t) file_size(fd);    if (size > 0)    {    new_font=THIS=(struct font *)xalloc(sizeof(struct font));       THREADS_ALLOW();   #ifdef HAVE_MMAP    new_font->mem =    mmap(0,size,PROT_READ,MAP_SHARED,fd,0);    new_font->mmaped_size=size;   #else