mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
kill fbuf_at(), eliminating static analyzer warning #1348
This commit is contained in:
parent
cd14e914fa
commit
39f9dd3b96
@ -107,7 +107,7 @@ endif()
|
||||
# global compiler flags
|
||||
add_compile_definitions(_FORTIFY_SOURCE=2)
|
||||
add_compile_options(-Wall -Wextra -W -Wshadow -Wformat -Wformat-security
|
||||
-fexceptions -fstrict-aliasing)
|
||||
-fanalyzer -fexceptions -fstrict-aliasing)
|
||||
|
||||
# don't use REQUIRED with subsequent find_package() operations; we use
|
||||
# feature_summary + set_package_properties to fail in one fell swoop.
|
||||
|
@ -30,14 +30,6 @@ typedef struct fbuf {
|
||||
|
||||
// header-only so that we can test it from notcurses-tester
|
||||
|
||||
static inline char*
|
||||
fbuf_at(fbuf* f, uint64_t at){
|
||||
if(at > f->used){
|
||||
return NULL;
|
||||
}
|
||||
return f->buf + at;
|
||||
}
|
||||
|
||||
#ifdef MAP_POPULATE
|
||||
#ifdef MAP_UNINITIALIZED
|
||||
#define MAPFLAGS (MAP_POPULATE | MAP_UNINITIALIZED)
|
||||
@ -168,7 +160,7 @@ fbuf_putc(fbuf* f, char c){
|
||||
if(fbuf_grow(f, 1)){
|
||||
return -1;
|
||||
}
|
||||
*fbuf_at(f, f->used++) = c;
|
||||
f->buf[f->used++] = c;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user