freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Devel] BUGREPORT: ATARI-PureC-Compiler with FT_SIZEOF_INT=2


From: PORTHOS
Subject: [Devel] BUGREPORT: ATARI-PureC-Compiler with FT_SIZEOF_INT=2
Date: Fri, 20 Sep 2002 13:16:16 +0200

Hallo,

another bugreport:






ahglobal.c:
===========
  /* simple insertion sort */
  static void
  sort_values( FT_Int   count,
               FT_Pos*  table )
  {
    FT_Int  i, j, swap;
----->FT_Pos swap !!!!

    for ( i = 1; i < count; i++ )
    {
      for ( j = i; j > 0; j-- )
      {
        if ( table[j] > table[j - 1] )
          break;

        swap         = table[j];
        table[j]     = table[j - 1];
        table[j - 1] = swap;
      }
    }
  }


---------------------------------------------------------------



  static FT_Error
  ah_hinter_compute_widths( AH_Hinter  hinter )
  {
    /* scan the array of segments in each direction */

.
.
.
      for ( ; seg < limit; seg++ )
      {
        link = seg->link;
        /* we only consider stem segments there! */
        if ( link && link->link == seg && link > seg )
        {
          FT_Int  dist;
-----> FT_Pos dist!!!!!!

          dist = seg->pos - link->pos;
          if ( dist < 0 )
            dist = -dist;

          if ( num_widths < 12 )
----->better: if ( num_widths < AH_MAX_WIDTHS )
            widths[num_widths++] = dist;
        }
      }


ahglyph.c
=========
  FT_LOCAL_DEF( void )
  ah_outline_scale_blue_edges( AH_Outline       outline,
                               AH_Face_Globals  globals )
  {
    AH_Edge  edge       = outline->horz_edges;
    AH_Edge  edge_limit = edge + outline->num_hedges;
    FT_Int   delta;
-----> FT_Pos delta!!!!!!


---------------------------------------------------------------


      /* now, compute each edge properties */
      for ( edge = edges; edge < edge_limit; edge++ )
      {
        int  is_round    = 0;  /* does it contain round segments?    */
----->FT_Int????
        int  is_straight = 0;  /* does it contain straight segments? */
----->FT_Int????
        int  ups         = 0;  /* number of upwards segments         */
-----> FT_Pos ups
        int  downs       = 0;  /* number of downwards segments       */
-----> FT_Pos downs


---------------------------------------------------------------


        if ( best_segment )
        {
          seg1->link  = best_segment;
          seg1->score = best_score;
----->seg1->score = (FT_Int) best_score; OR AH_Segment.score must be FT_Pos

          best_segment->num_linked++;
        }


---------------------------------------------------------------


  /* this function is used by ah_get_orientation (see below) to test */
  /* the fill direction of a given bbox extrema                      */
  static int
----->static FT_Pos!!!!
  ah_test_extrema( FT_Outline*  outline,
                   int          n )
----->FT_Pos n!!!!
  {
    FT_Vector  *prev, *cur, *next;
    FT_Pos      product;
    FT_Int      first, last, c;


---------------------------------------------------------------


  static int
  ah_get_orientation( FT_Outline*  outline )
  {
    FT_BBox  box;
    FT_BBox  indices;
    int      n, last;
----->FT_Pos n!!!!
----->FT_Int last??


---------------------------------------------------------------


  static int
----->static FT_Int!!!!
  ah_get_orientation( FT_Outline*  outline )
  {
    FT_BBox  box;
    FT_BBox  indices;
    FT_Pos      n;
    FT_Int      last;


    indices.xMin = -1;
    indices.yMin = -1;
    indices.xMax = -1;
    indices.yMax = -1;

    box.xMin = box.yMin =  32767L;
    box.xMax = box.yMax = -32768L;

    /* is it empty? */
    if ( outline->n_contours < 1 )
      return 1;

    last = outline->contours[outline->n_contours - 1];

    for ( n = 0; n <= last; n++ )
    {
      FT_Pos  x, y;


      x = outline->points[n].x;
      if ( x < box.xMin )
      {
        box.xMin     = x;
        indices.xMin = n;
      }
      if ( x > box.xMax )
      {
        box.xMax     = x;
        indices.xMax = n;
      }

      y = outline->points[n].y;
      if ( y < box.yMin )
      {
        box.yMin     = y;
        indices.yMin = n;
      }
      if ( y > box.yMax )
      {
        box.yMax     = y;
        indices.yMax = n;
      }
    }

    /* test orientation of the xmin */
    n = ah_test_extrema( outline, indices.xMin );
    if ( n )
      goto Exit;

    n = ah_test_extrema( outline, indices.yMin );
    if ( n )
      goto Exit;

    n = ah_test_extrema( outline, indices.xMax );
    if ( n )
      goto Exit;

    n = ah_test_extrema( outline, indices.yMax );
    if ( !n )
      n = 1;

  Exit:
    return n;
----->return (FT_Int) n;
  }




-- 
Mit freundlichen Grüßen,
Wolfgang Domröse
mailto:address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]