diff options
author | sleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2014-11-22 22:34:19 +0000 |
---|---|---|
committer | sleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2014-11-22 22:34:19 +0000 |
commit | 0a57b790871b27ea6fd3b1ba97474dddcce7845f (patch) | |
tree | 0ad46b248e42f96e93b54874aa3b073ad1273aa1 /navit/support | |
parent | cffcb036be4aa6097d064c5fb55f3de1a84b23d0 (diff) | |
download | navit-svn-0a57b790871b27ea6fd3b1ba97474dddcce7845f.tar.gz |
Refactor:core:Introduce enum for debug levels, and use it everywhere.|First part of #1269.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5960 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/support')
-rw-r--r-- | navit/support/libc/stat.c | 8 | ||||
-rw-r--r-- | navit/support/win32/serial_io.c | 16 | ||||
-rw-r--r-- | navit/support/wordexp/glob.c | 6 |
3 files changed, 15 insertions, 15 deletions
diff --git a/navit/support/libc/stat.c b/navit/support/libc/stat.c index e6ed452e..393b9f7c 100644 --- a/navit/support/libc/stat.c +++ b/navit/support/libc/stat.c @@ -120,13 +120,13 @@ _stat (const char *path, struct _stat *st) size_t len; int exec; - dbg(0,"path=%s\n",path); + dbg(lvl_error,"path=%s\n",path); mbstowcs (pathw, path, MAX_PATH); - dbg(0,"wide path=%S\n",pathw); + dbg(lvl_error,"wide path=%S\n",pathw); if((h = FindFirstFileW (pathw, &fd)) == INVALID_HANDLE_VALUE) { DWORD dwError = GetLastError (); - dbg(0,"no file\n"); + dbg(lvl_error,"no file\n"); if(dwError == ERROR_NO_MORE_FILES) /* Convert error to something more sensible. */ SetLastError (ERROR_FILE_NOT_FOUND); @@ -139,7 +139,7 @@ _stat (const char *path, struct _stat *st) exec = (len >= 4 && strcasecmp (path + len - 4, ".exe") == 0); ret = __stat_by_file_info (&sfi, st, exec); - dbg(0,"ret=%d\n",ret); + dbg(lvl_error,"ret=%d\n",ret); FindClose (h); return ret; } diff --git a/navit/support/win32/serial_io.c b/navit/support/win32/serial_io.c index 33ca5fe6..c2461949 100644 --- a/navit/support/win32/serial_io.c +++ b/navit/support/win32/serial_io.c @@ -51,7 +51,7 @@ int serial_io_init( const char* port, const char* strsettings ) 0, NULL ); - dbg(1, "return (fd) : '-1' : serial_io_init error : '%s'\n", lpMsgBuf); + dbg(lvl_warning, "return (fd) : '-1' : serial_io_init error : '%s'\n", lpMsgBuf); LocalFree( lpMsgBuf ); // Free the buffer. return -1; @@ -72,7 +72,7 @@ int serial_io_init( const char* port, const char* strsettings ) SetCommTimeouts(hCom, &sCT); - dbg(1, "serial_io_init return (fd) : '%d'\n", (int)hCom); + dbg(lvl_warning, "serial_io_init return (fd) : '%d'\n", (int)hCom); return (int)hCom; } @@ -94,12 +94,12 @@ int serial_io_init( const char* port, const char* strsettings ) int serial_io_read( int fd, char * buffer, int buffer_size ) { DWORD dwBytesIn = 0; - dbg(1, "serial_io_read fd = %d buffer_size = %d\n", fd, buffer_size); + dbg(lvl_warning, "serial_io_read fd = %d buffer_size = %d\n", fd, buffer_size); if (fd <= 0) { - dbg(0, "serial_io_read return (dwBytesIn) : '0'\n"); + dbg(lvl_error, "serial_io_read return (dwBytesIn) : '0'\n"); *buffer = 0; return 0; } @@ -117,11 +117,11 @@ int serial_io_read( int fd, char * buffer, int buffer_size ) } if (dwBytesIn > 0) { - dbg(1,"GPS < %s\n",buffer ); + dbg(lvl_warning,"GPS < %s\n",buffer ); } buffer[buffer_size - 1] = 0; - dbg(2, "serial_io_read return (dwBytesIn) : '%d'\n", dwBytesIn); + dbg(lvl_info, "serial_io_read return (dwBytesIn) : '%d'\n", dwBytesIn); return dwBytesIn; } @@ -139,7 +139,7 @@ int serial_io_read( int fd, char * buffer, int buffer_size ) int serial_io_write(int fd, const char * buffer) { DWORD dwBytesOut = 0; - dbg(1, "serial_io_write fd = %d buffer = '%s'\n",fd, buffer); + dbg(lvl_warning, "serial_io_write fd = %d buffer = '%s'\n",fd, buffer); WriteFile((HANDLE)fd, buffer, strlen(buffer), &dwBytesOut, NULL); @@ -157,7 +157,7 @@ int serial_io_write(int fd, const char * buffer) **/ void serial_io_shutdown(int fd ) { - dbg(1, "serial_io_shutdown fd = %d\n",fd); + dbg(lvl_warning, "serial_io_shutdown fd = %d\n",fd); if (fd > 0) { diff --git a/navit/support/wordexp/glob.c b/navit/support/wordexp/glob.c index 6c935f44..d6282c4a 100644 --- a/navit/support/wordexp/glob.c +++ b/navit/support/wordexp/glob.c @@ -130,7 +130,7 @@ glob_recursive(const char *path1, const char *path2, const char *pattern, int fl strcat(path, "/"); strcat(path, path2); if (!strlen(pattern)) { - dbg(1,"found %s\n",path); + dbg(lvl_warning,"found %s\n",path); pglob->gl_pathv=realloc(pglob->gl_pathv, (pglob->gl_pathc+1)*sizeof(char *)); if (!pglob->gl_pathv) { pglob->gl_pathc=0; @@ -139,7 +139,7 @@ glob_recursive(const char *path1, const char *path2, const char *pattern, int fl pglob->gl_pathv[pglob->gl_pathc++]=path; return 0; } - dbg(1,"searching for %s in %s\n",pattern,path); + dbg(lvl_warning,"searching for %s in %s\n",pattern,path); flen=strcspn(pattern,"/"); next=pattern+flen; if (*next == '/') @@ -150,7 +150,7 @@ glob_recursive(const char *path1, const char *path2, const char *pattern, int fl if (glob_requires_match(fname, 0)) { DIR *dh; struct dirent *de; - dbg(1,"in dir %s search for %s\n",path,fname); + dbg(lvl_warning,"in dir %s search for %s\n",path,fname); dh=opendir(path); if (dh) { while ((de=readdir(dh))) { |