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

version» Context lines:

pike.git/src/modules/Image/font.c:163:    struct _char    {    unsigned long width; /* character rectangle has this width in pixels */    unsigned long spacing; /* pixels to next character */    unsigned char *pixels; /* character rectangle */    } charinfo [1]; /* many!! */   };      /***************** init & exit *********************************/    - static INLINE void free_font_struct(struct font *font) + static inline void free_font_struct(struct font *font)   {    if (font)    {    if (font->mem && font->mem!=image_default_font)    {   #ifdef HAVE_MMAP    if (font->mmaped_size) {    munmap(font->mem,font->mmaped_size);    } else   #else
pike.git/src/modules/Image/font.c:195:   }      static void exit_font_struct(struct object *UNUSED(obj))   {    free_font_struct(THIS);    THIS=NULL;   }      /***************** internals ***********************************/    - static INLINE int char_space(struct font *this, INT32 c) + static inline int char_space(struct font *this, INT32 c)   {    if(c==0x20)    return DOUBLE_TO_INT((double)(this->height*this->xspacing_scale)/4.5);    else if(c==0x20+128)    return DOUBLE_TO_INT((this->height*this->xspacing_scale)/18);    return DOUBLE_TO_INT(this->charinfo[c].spacing*this->xspacing_scale);   }    - static INLINE int char_width(struct font *this, INT32 c) + static inline int char_width(struct font *this, INT32 c)   {    if(c==0x20 || c==0x20+128) return 0;    return this->charinfo[c].width;   }    - static INLINE ptrdiff_t my_read(int fd, void *t, size_t towrite) + static inline ptrdiff_t my_read(int fd, void *t, size_t towrite)   {    ptrdiff_t res;    while((res = fd_read(fd, t, towrite)) < 0)    {    switch(errno)    {    case EAGAIN: case EINTR:    continue;       default:    res = 0;    return 0;    }    }    return res;   }    - static INLINE off_t file_size(int fd) + static inline off_t file_size(int fd)   {    PIKE_STAT_T tmp;    if((!fd_fstat(fd, &tmp)) &&    ( tmp.st_mode & S_IFMT) == S_IFREG)    return (off_t)tmp.st_size;    return -1;   }    - static INLINE void write_char(struct _char *ci, + static inline void write_char(struct _char *ci,    rgb_group *pos,    INT32 xsize,    INT32 height)   {    rgb_group *nl;    INT32 x,y;    unsigned char *p;    p=ci->pixels;       for (y=height; y>0; y--)