Skip to content

Commit

Permalink
misc: cleanup includes
Browse files Browse the repository at this point in the history
Signed-off-by: He Xian <hexian000@outlook.com>
  • Loading branch information
hexian000 committed Dec 26, 2024
1 parent 3451cd5 commit 23e7640
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 0 additions & 2 deletions contrib/csnippets/math/rand.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
#include "rand.h"

#include <float.h>
#include <stdbool.h>
#include <stdint.h>
#include <time.h>

#define ROTL(x, r) (((x) << (r)) | ((x) >> ((sizeof(x) * 8) - (r))))

Expand Down
5 changes: 4 additions & 1 deletion contrib/csnippets/utils/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@

#include "buffer.h"

#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int buf_vappendf(struct buffer *restrict buf, const char *format, va_list args)
{
Expand Down Expand Up @@ -62,7 +65,7 @@ vbuf_grow(struct vbuffer *restrict vbuf, const size_t want, const size_t maxcap)

struct vbuffer *restrict newbuf =
realloc(vbuf, sizeof(struct vbuffer) + cap);
if (newbuf == NULL && want < cap) {
if (newbuf == NULL) {
/* retry with minimal required capacity */
cap = want;
newbuf = realloc(vbuf, sizeof(struct vbuffer) + cap);
Expand Down
2 changes: 1 addition & 1 deletion contrib/csnippets/utils/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <wchar.h>
#include <wctype.h>

Expand Down

0 comments on commit 23e7640

Please sign in to comment.