Deprecate memset(3) in favour of C99 compound literals
This commit is contained in:
parent
e636accfd5
commit
1ea5a4d4a4
|
@ -2,10 +2,6 @@
|
|||
#include <gfx/port.h>
|
||||
#include <sdl-1.2/gfx_private.h>
|
||||
#include <SDL/SDL.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
void rect_sort(struct rect *const r)
|
||||
{
|
||||
|
@ -29,7 +25,7 @@ void rect_sort(struct rect *const r)
|
|||
|
||||
void rect_init(struct rect *const r)
|
||||
{
|
||||
memset(r, 0, sizeof *r);
|
||||
*r = (const struct rect){0};
|
||||
}
|
||||
|
||||
void semitrans_rect_init(struct rect *const r)
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include <errno.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
void sprite_free(struct sprite *const s)
|
||||
{
|
||||
|
@ -92,12 +91,13 @@ static int load_bitmap(struct sprite *const s, FILE *const f)
|
|||
end:
|
||||
SDL_FreeRW(ops);
|
||||
SDL_FreeSurface(ts);
|
||||
SDL_FreeSurface(zs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int sprite_from_fp(struct sprite *const s, FILE *const f)
|
||||
{
|
||||
memset(s, 0, sizeof *s);
|
||||
*s = (const struct sprite){0};
|
||||
|
||||
if (load_header(s, f) || load_bitmap(s, f))
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue