Changes in uspace/lib/draw/font/pcf.c [1d6dd2a:38d150e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/draw/font/pcf.c
r1d6dd2a r38d150e 42 42 #include <offset.h> 43 43 #include <stdlib.h> 44 #include <str.h>45 44 46 45 #include "pcf.h" … … 147 146 } 148 147 149 static errno_t pcf_resolve_glyph(void *opaque_data, const wchar_t chr,148 static int pcf_resolve_glyph(void *opaque_data, const wchar_t chr, 150 149 glyph_id_t *glyph_id) 151 150 { … … 184 183 } 185 184 186 static errno_t load_glyph_metrics(pcf_data_t *data, uint32_t glyph_id,185 static int load_glyph_metrics(pcf_data_t *data, uint32_t glyph_id, 187 186 pcf_toc_entry_t *table, pcf_default_metrics_t *metrics) 188 187 { … … 254 253 } 255 254 256 static errno_t pcf_load_glyph_surface(void *opaque_data, glyph_id_t glyph_id,255 static int pcf_load_glyph_surface(void *opaque_data, glyph_id_t glyph_id, 257 256 surface_t **out_surface) 258 257 { … … 261 260 pcf_default_metrics_t pcf_metrics; 262 261 memset(&pcf_metrics, 0, sizeof(pcf_default_metrics_t)); 263 errno_t rc = load_glyph_metrics(data, glyph_id, &data->metrics_table,262 int rc = load_glyph_metrics(data, glyph_id, &data->metrics_table, 264 263 &pcf_metrics); 265 264 if (rc != EOK) … … 269 268 (glyph_id * sizeof(uint32_t)); 270 269 271 if (fseek(data->file, offset, SEEK_SET) < 0) 270 rc = fseek(data->file, offset, SEEK_SET); 271 if (rc != 0) 272 272 return errno; 273 273 … … 284 284 + bitmap_offset; 285 285 286 if (fseek(data->file, offset, SEEK_SET) < 0) 286 rc = fseek(data->file, offset, SEEK_SET); 287 if (rc != 0) 287 288 return errno; 288 289 … … 340 341 } 341 342 342 static errno_t pcf_load_glyph_metrics(void *opaque_data, glyph_id_t glyph_id,343 static int pcf_load_glyph_metrics(void *opaque_data, glyph_id_t glyph_id, 343 344 glyph_metrics_t *gm) 344 345 { … … 347 348 pcf_default_metrics_t pcf_metrics; 348 349 memset(&pcf_metrics, 0, sizeof(pcf_default_metrics_t)); 349 errno_t rc = load_glyph_metrics(data, glyph_id, &data->metrics_table,350 int rc = load_glyph_metrics(data, glyph_id, &data->metrics_table, 350 351 &pcf_metrics); 351 352 if (rc != EOK) … … 378 379 }; 379 380 380 static errno_t pcf_read_toc(pcf_data_t *data)381 static int pcf_read_toc(pcf_data_t *data) 381 382 { 382 383 int rc = fseek(data->file, 0, SEEK_END); … … 461 462 } 462 463 463 static errno_t pcf_seek_table_header(pcf_data_t *data, pcf_toc_entry_t *table)464 static int pcf_seek_table_header(pcf_data_t *data, pcf_toc_entry_t *table) 464 465 { 465 466 uint32_t format; … … 479 480 } 480 481 481 static errno_t pcf_read_bitmap_table_header(pcf_data_t *data)482 { 483 errno_t rc = pcf_seek_table_header(data, &data->bitmap_table);482 static int pcf_read_bitmap_table_header(pcf_data_t *data) 483 { 484 int rc = pcf_seek_table_header(data, &data->bitmap_table); 484 485 if (rc != EOK) 485 486 return rc; … … 499 500 } 500 501 501 static errno_t pcf_read_metrics_table_header(pcf_data_t *data)502 { 503 errno_t rc = pcf_seek_table_header(data, &data->metrics_table);502 static int pcf_read_metrics_table_header(pcf_data_t *data) 503 { 504 int rc = pcf_seek_table_header(data, &data->metrics_table); 504 505 if (rc != EOK) 505 506 return rc; … … 532 533 } 533 534 534 static errno_t pcf_read_encodings_table_header(pcf_data_t *data)535 { 536 errno_t rc = pcf_seek_table_header(data, &data->encodings_table);535 static int pcf_read_encodings_table_header(pcf_data_t *data) 536 { 537 int rc = pcf_seek_table_header(data, &data->encodings_table); 537 538 if (rc != EOK) 538 539 return rc; … … 559 560 } 560 561 561 static errno_t pcf_read_accelerators_table(pcf_data_t *data)562 { 563 errno_t rc = pcf_seek_table_header(data, &data->accelerators_table);562 static int pcf_read_accelerators_table(pcf_data_t *data) 563 { 564 int rc = pcf_seek_table_header(data, &data->accelerators_table); 564 565 if (rc != EOK) 565 566 return rc; … … 580 581 } 581 582 582 errno_t pcf_font_create(font_t **font, char *filename, uint16_t points)583 { 584 errno_t rc;583 int pcf_font_create(font_t **font, char *filename, uint16_t points) 584 { 585 int rc; 585 586 pcf_data_t *data = malloc(sizeof(pcf_data_t)); 586 587 if (data == NULL)
Note:
See TracChangeset
for help on using the changeset viewer.