Changeset d145ecb in mainline
- Timestamp:
- 2020-09-21T14:02:42Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- aaf962e6
- Parents:
- 003c413
- Location:
- uspace/lib
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/gfxfont/src/font.c
r003c413 rd145ecb 375 375 return rc; 376 376 377 rc = riff_w chunk_write(riffw, (void *) props, sizeof(*props));377 rc = riff_write(riffw, (void *) props, sizeof(*props)); 378 378 if (rc != EOK) 379 379 return rc; … … 402 402 return rc; 403 403 404 rc = riff_w chunk_write(riffw, (void *) metrics, sizeof(*metrics));404 rc = riff_write(riffw, (void *) metrics, sizeof(*metrics)); 405 405 if (rc != EOK) 406 406 return rc; … … 445 445 return rc; 446 446 447 rc = riff_w chunk_write(riffw, (void *) alloc.pixels,447 rc = riff_write(riffw, (void *) alloc.pixels, 448 448 font->rect.p1.x * font->rect.p1.y * sizeof(uint32_t)); 449 449 if (rc != EOK) -
uspace/lib/gfxfont/src/glyph.c
r003c413 rd145ecb 331 331 return rc; 332 332 333 rc = riff_w chunk_write(riffw, (void *) metrics, sizeof(*metrics));333 rc = riff_write(riffw, (void *) metrics, sizeof(*metrics)); 334 334 if (rc != EOK) 335 335 return rc; … … 363 363 str = gfx_glyph_pattern_str(pat); 364 364 365 rc = riff_w chunk_write(riffw, (void *) str, 1 + str_size(str));365 rc = riff_write(riffw, (void *) str, 1 + str_size(str)); 366 366 if (rc != EOK) 367 367 return rc; … … 393 393 return rc; 394 394 395 rc = riff_wchunk_write(riffw, (void *) &glyph->rect, 396 sizeof(glyph->rect)); 397 if (rc != EOK) 398 return rc; 399 400 rc = riff_wchunk_write(riffw, (void *) &glyph->origin, 401 sizeof(glyph->origin)); 395 rc = riff_write(riffw, (void *) &glyph->rect, sizeof(glyph->rect)); 396 if (rc != EOK) 397 return rc; 398 399 rc = riff_write(riffw, (void *) &glyph->origin, sizeof(glyph->origin)); 402 400 if (rc != EOK) 403 401 return rc; -
uspace/lib/riff/include/riff/chunk.h
r003c413 rd145ecb 45 45 extern errno_t riff_wchunk_start(riffw_t *, riff_ckid_t, riff_wchunk_t *); 46 46 extern errno_t riff_wchunk_end(riffw_t *, riff_wchunk_t *); 47 extern errno_t riff_w chunk_write(riffw_t *, void *, size_t);47 extern errno_t riff_write(riffw_t *, void *, size_t); 48 48 extern errno_t riff_write_uint32(riffw_t *, uint32_t); 49 49 … … 54 54 extern errno_t riff_rchunk_end(riff_rchunk_t *); 55 55 extern errno_t riff_read(riff_rchunk_t *, void *, size_t, size_t *); 56 extern uint32_t riff_rchunk_size(riff_rchunk_t *); 56 57 57 58 #endif -
uspace/lib/riff/meson.build
r003c413 rd145ecb 31 31 'src/rwave.c', 32 32 ) 33 34 test_src = files( 35 'test/chunk.c', 36 'test/main.c', 37 'test/rwave.c', 38 ) -
uspace/lib/riff/src/chunk.c
r003c413 rd145ecb 152 152 153 153 cksize = pos - wchunk->ckstart; 154 if (pos % 2 != 0) 155 ++pos; 154 156 155 157 if (fseek(rw->f, wchunk->ckstart - 4, SEEK_SET) < 0) … … 176 178 * @return EOK on success, EIO on error. 177 179 */ 178 errno_t riff_w chunk_write(riffw_t *rw, void *data, size_t bytes)180 errno_t riff_write(riffw_t *rw, void *data, size_t bytes) 179 181 { 180 182 size_t nw; … … 281 283 return rc; 282 284 285 if (nread != sizeof(vle)) 286 return ELIMIT; 287 283 288 *v = uint32_t_le2host(vle); 284 289 return EOK; … … 315 320 error: 316 321 return rc; 322 } 323 324 /** Return chunk data size. 325 * 326 * @param rchunk RIFF chunk 327 * @return Pure data size (excluding type+size header) in bytes 328 */ 329 uint32_t riff_rchunk_size(riff_rchunk_t *rchunk) 330 { 331 return rchunk->cksize; 317 332 } 318 333 -
uspace/lib/riff/src/rwave.c
r003c413 rd145ecb 137 137 goto error; 138 138 139 rc = riff_w chunk_write(ww->rw, &rwfmt, sizeof(rwfmt));139 rc = riff_write(ww->rw, &rwfmt, sizeof(rwfmt)); 140 140 if (rc != EOK) 141 141 goto error; … … 196 196 } 197 197 198 rc = riff_w chunk_write(ww->rw, ww->buf, now);198 rc = riff_write(ww->rw, ww->buf, now); 199 199 if (rc != EOK) { 200 200 assert(rc == EIO);
Note:
See TracChangeset
for help on using the changeset viewer.