Add more warning flags, fix a few new warnings
This commit is contained in:
+1
-1
@@ -54,7 +54,7 @@ env = Environment(tools = ['default', 'textfile'])
|
|||||||
env.AddMethod(InstallPerm)
|
env.AddMethod(InstallPerm)
|
||||||
Export('env', 'build_type', 'prefix', 'version_info', 'test_xml')
|
Export('env', 'build_type', 'prefix', 'version_info', 'test_xml')
|
||||||
|
|
||||||
env.Append(CFLAGS = ['-Wall', '-Wextra', '-pipe', '-ggdb', '-pthread'])
|
env.Append(CFLAGS = ['-Wall', '-Wextra', '-Wundef', '-Wcast-qual','-Wshadow' ,'-Wcast-align','-pipe', '-ggdb', '-pthread'])
|
||||||
env.Append(LINKFLAGS = ['-O2', '-pthread'])
|
env.Append(LINKFLAGS = ['-O2', '-pthread'])
|
||||||
env.Append(CPPDEFINES = ['_FILE_OFFSET_BITS=64'])
|
env.Append(CPPDEFINES = ['_FILE_OFFSET_BITS=64'])
|
||||||
env.Append(CPPPATH = ['#include'])
|
env.Append(CPPPATH = ['#include'])
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
#include "ucore_timers.h"
|
#include "ucore_timers.h"
|
||||||
|
|
||||||
#define MUX_EV_READ (1 << 0x00)
|
#define MUX_EV_READ (1U << 0x00)
|
||||||
#define MUX_EV_WRITE (1 << 0x01)
|
#define MUX_EV_WRITE (1U << 0x01)
|
||||||
//#define MUX_EV_EXCEPT (1 << 0x02)
|
//#define MUX_EV_EXCEPT (1 << 0x02)
|
||||||
#define MUX_EV_MASK (MUX_EV_READ | MUX_EV_WRITE )
|
#define MUX_EV_MASK (MUX_EV_READ | MUX_EV_WRITE )
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -112,7 +112,7 @@ static int iomux_select_unregister_fd(struct IOMux *mux_, struct IOMuxFD *fd)
|
|||||||
size_t i;
|
size_t i;
|
||||||
for(i = 0; i < mux->num_descriptors; i++) {
|
for(i = 0; i < mux->num_descriptors; i++) {
|
||||||
if(fd == mux->descriptors[i]) {
|
if(fd == mux->descriptors[i]) {
|
||||||
int what = fd->what; //make sure we don't alter 'what' as seen from the user
|
unsigned int what = fd->what; //make sure we don't alter 'what' as seen from the user
|
||||||
fd->what &= ~MUX_EV_MASK;
|
fd->what &= ~MUX_EV_MASK;
|
||||||
iomux_select_update_events(mux_, fd);
|
iomux_select_update_events(mux_, fd);
|
||||||
mux->descriptors[i] = NULL; //set the slot to NULL, the event loop needs to rebuild it.
|
mux->descriptors[i] = NULL; //set the slot to NULL, the event loop needs to rebuild it.
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ uc_murmurmash2(const void *key, int len, uint32_t seed )
|
|||||||
|
|
||||||
while(len >= 4)
|
while(len >= 4)
|
||||||
{
|
{
|
||||||
uint32_t k = *(uint32_t *)data;
|
uint32_t k = *(const uint32_t *)data;
|
||||||
|
|
||||||
k *= m;
|
k *= m;
|
||||||
k ^= k >> r;
|
k ^= k >> r;
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ char*
|
|||||||
uc_sprintbc(char *result, unsigned char value)
|
uc_sprintbc(char *result, unsigned char value)
|
||||||
{
|
{
|
||||||
char *s = result;
|
char *s = result;
|
||||||
unsigned char mask = ~((unsigned char) (~0) >> 1);
|
unsigned char mask = ~((unsigned char) (~0U) >> 1U);
|
||||||
|
|
||||||
if (s) {
|
if (s) {
|
||||||
while (mask) {
|
while (mask) {
|
||||||
*s++ = (mask & value) ? '1' : '0';
|
*s++ = (mask & value) ? '1' : '0';
|
||||||
mask >>= 1;
|
mask >>= 1U;
|
||||||
}
|
}
|
||||||
*s = '\0';
|
*s = '\0';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user