mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-04 18:28:30 +00:00
Fix warnings
This change fixes Cosmopolitan so it has fewer opinions about compiler warnings. The whole repository had to be cleaned up to be buildable in -Werror -Wall mode. This lets us benefit from things like strict const checking. Some actual bugs might have been caught too.
This commit is contained in:
parent
e2b3c3618e
commit
0d748ad58e
571 changed files with 1306 additions and 1888 deletions
|
@ -28,9 +28,9 @@ extern const struct MagnumStr kSockOptnames[];
|
|||
extern const struct MagnumStr kTcpOptnames[];
|
||||
extern const struct MagnumStr kPollNames[];
|
||||
|
||||
char *DescribeMagnum(char *, const struct MagnumStr *, const char *, int);
|
||||
const char *DescribeMagnum(char *, const struct MagnumStr *, const char *, int);
|
||||
|
||||
__funline char *GetMagnumStr(const struct MagnumStr *ms, int x) {
|
||||
__funline const char *GetMagnumStr(const struct MagnumStr *ms, int x) {
|
||||
int i;
|
||||
for (i = 0; ms[i].x != MAGNUM_TERMINATOR; ++i) {
|
||||
if (x == MAGNUM_NUMBER(ms, i)) {
|
||||
|
@ -44,7 +44,7 @@ __funline char *GetMagnumStr(const struct MagnumStr *ms, int x) {
|
|||
* Converts errno value to descriptive sentence.
|
||||
* @return non-null rodata string or null if not found
|
||||
*/
|
||||
__funline char *_strerdoc(int x) {
|
||||
__funline const char *_strerdoc(int x) {
|
||||
if (x) {
|
||||
return GetMagnumStr(kErrnoDocs, x);
|
||||
} else {
|
||||
|
@ -56,7 +56,7 @@ __funline char *_strerdoc(int x) {
|
|||
* Converts errno value to symbolic name.
|
||||
* @return non-null rodata string or null if not found
|
||||
*/
|
||||
__funline char *_strerrno(int x) {
|
||||
__funline const char *_strerrno(int x) {
|
||||
if (x) {
|
||||
return GetMagnumStr(kErrnoNames, x);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue