* util/grub-mkfont.c (process_cursive): Remove nested function.
This commit is contained in:
		
							parent
							
								
									e6c368d468
								
							
						
					
					
						commit
						6ab537e324
					
				
					 2 changed files with 24 additions and 19 deletions
				
			
		|  | @ -1,3 +1,7 @@ | ||||||
|  | 2013-11-07  Vladimir Serbinenko  <phcoder@gmail.com> | ||||||
|  | 
 | ||||||
|  | 	* util/grub-mkfont.c (process_cursive): Remove nested function. | ||||||
|  | 
 | ||||||
| 2013-11-07  Vladimir Serbinenko  <phcoder@gmail.com> | 2013-11-07  Vladimir Serbinenko  <phcoder@gmail.com> | ||||||
| 
 | 
 | ||||||
| 	* include/grub/misc.h (grub_dprintf): Use unnamed vararg. | 	* include/grub/misc.h (grub_dprintf): Use unnamed vararg. | ||||||
|  |  | ||||||
|  | @ -468,30 +468,31 @@ add_subst (grub_uint32_t from, grub_uint32_t to, struct glyph_replace **target) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void | static void | ||||||
| process_cursive (struct gsub_feature *feature, | subst (const struct gsub_substitution *sub, grub_uint32_t glyph, | ||||||
| 		 struct gsub_lookup_list *lookups, |        struct glyph_replace **target, int *i) | ||||||
| 		 grub_uint32_t feattag) |  | ||||||
| { |  | ||||||
|   int j, k; |  | ||||||
|   int i; |  | ||||||
|   struct glyph_replace **target; |  | ||||||
|   struct gsub_substitution *sub; |  | ||||||
| 
 |  | ||||||
|   auto inline void subst (grub_uint32_t glyph); |  | ||||||
|   void subst (grub_uint32_t glyph) |  | ||||||
| { | { | ||||||
|   grub_uint16_t substtype; |   grub_uint16_t substtype; | ||||||
|   substtype = grub_be_to_cpu16 (sub->type); |   substtype = grub_be_to_cpu16 (sub->type); | ||||||
| 
 | 
 | ||||||
|   if (substtype == GSUB_SUBSTITUTION_DELTA) |   if (substtype == GSUB_SUBSTITUTION_DELTA) | ||||||
|     add_subst (glyph, glyph + grub_be_to_cpu16 (sub->delta), target); |     add_subst (glyph, glyph + grub_be_to_cpu16 (sub->delta), target); | ||||||
|     else if (i >= grub_be_to_cpu16 (sub->count)) |   else if (*i >= grub_be_to_cpu16 (sub->count)) | ||||||
|       printf (_("Out of range substitution (%d, %d)\n"), i, |     printf (_("Out of range substitution (%d, %d)\n"), *i, | ||||||
| 	    grub_be_to_cpu16 (sub->count)); | 	    grub_be_to_cpu16 (sub->count)); | ||||||
|   else |   else | ||||||
|       add_subst (glyph, grub_be_to_cpu16 (sub->repl[i++]), target); |     add_subst (glyph, grub_be_to_cpu16 (sub->repl[(*i)++]), target); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | static void | ||||||
|  | process_cursive (struct gsub_feature *feature, | ||||||
|  | 		 struct gsub_lookup_list *lookups, | ||||||
|  | 		 grub_uint32_t feattag) | ||||||
|  | { | ||||||
|  |   int j, k; | ||||||
|  |   int i; | ||||||
|  |   struct glyph_replace **target = NULL; | ||||||
|  |   struct gsub_substitution *sub; | ||||||
|  | 
 | ||||||
|   for (j = 0; j < grub_be_to_cpu16 (feature->lookupcount); j++) |   for (j = 0; j < grub_be_to_cpu16 (feature->lookupcount); j++) | ||||||
|     { |     { | ||||||
|       int lookup_index = grub_be_to_cpu16 (feature->lookupindices[j]); |       int lookup_index = grub_be_to_cpu16 (feature->lookupindices[j]); | ||||||
|  | @ -552,14 +553,14 @@ process_cursive (struct gsub_feature *feature, | ||||||
| 	  void *coverage = (grub_uint8_t *) sub | 	  void *coverage = (grub_uint8_t *) sub | ||||||
| 	    + grub_be_to_cpu16 (sub->coverage_off); | 	    + grub_be_to_cpu16 (sub->coverage_off); | ||||||
| 	  grub_uint32_t covertype; | 	  grub_uint32_t covertype; | ||||||
| 	  covertype = grub_be_to_cpu16 (*(grub_uint16_t * __attribute__ ((packed))) coverage); | 	  covertype = grub_be_to_cpu16 (grub_get_unaligned16 (coverage)); | ||||||
| 	  i = 0; | 	  i = 0; | ||||||
| 	  if (covertype == GSUB_COVERAGE_LIST) | 	  if (covertype == GSUB_COVERAGE_LIST) | ||||||
| 	    { | 	    { | ||||||
| 	      struct gsub_coverage_list *cover = coverage; | 	      struct gsub_coverage_list *cover = coverage; | ||||||
| 	      int l; | 	      int l; | ||||||
| 	      for (l = 0; l < grub_be_to_cpu16 (cover->count); l++) | 	      for (l = 0; l < grub_be_to_cpu16 (cover->count); l++) | ||||||
| 		subst (grub_be_to_cpu16 (cover->glyphs[l])); | 		subst (sub, grub_be_to_cpu16 (cover->glyphs[l]), target, &i); | ||||||
| 	    } | 	    } | ||||||
| 	  else if (covertype == GSUB_COVERAGE_RANGE) | 	  else if (covertype == GSUB_COVERAGE_RANGE) | ||||||
| 	    { | 	    { | ||||||
|  | @ -568,7 +569,7 @@ process_cursive (struct gsub_feature *feature, | ||||||
| 	      for (l = 0; l < grub_be_to_cpu16 (cover->count); l++) | 	      for (l = 0; l < grub_be_to_cpu16 (cover->count); l++) | ||||||
| 		for (m = grub_be_to_cpu16 (cover->ranges[l].start); | 		for (m = grub_be_to_cpu16 (cover->ranges[l].start); | ||||||
| 		     m <= grub_be_to_cpu16 (cover->ranges[l].end); m++) | 		     m <= grub_be_to_cpu16 (cover->ranges[l].end); m++) | ||||||
| 		  subst (m); | 		  subst (sub, m, target, &i); | ||||||
| 	    } | 	    } | ||||||
| 	  else | 	  else | ||||||
| 	    /* TRANSLATORS: most font transformations apply only to
 | 	    /* TRANSLATORS: most font transformations apply only to
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue