aboutsummaryrefslogtreecommitdiffstats
path: root/src/ckerrlog.c
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2018-10-26 16:00:29 +0300
committergramanas <anastasis.gramm2@gmail.com>2018-10-26 16:02:07 +0300
commit41ae1a0f0d86d2fc19f333ee23889c11beb0a4dd (patch)
treeb29207e44aa8dcc10ef2deb51ac1514fb934c420 /src/ckerrlog.c
parenta6b2b4b2a4095d2f95419df986378e54432c2d71 (diff)
downloadck-41ae1a0f0d86d2fc19f333ee23889c11beb0a4dd.tar.gz
ck-41ae1a0f0d86d2fc19f333ee23889c11beb0a4dd.tar.bz2
ck-41ae1a0f0d86d2fc19f333ee23889c11beb0a4dd.zip
Confort to pedantic std-c99 and update readme
Diffstat (limited to 'src/ckerrlog.c')
-rw-r--r--src/ckerrlog.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/ckerrlog.c b/src/ckerrlog.c
index a023521..cfafb39 100644
--- a/src/ckerrlog.c
+++ b/src/ckerrlog.c
@@ -31,7 +31,7 @@ char *get_time() {
return buf;
}
-void log_command(int argc, char* argv[]) {
+void log_command(int argc,const char* argv[]) {
char tmp[STR_L] = "";
for(int i = 0; i < argc; i++) {
strcat(tmp, argv[i]);
@@ -41,7 +41,8 @@ void log_command(int argc, char* argv[]) {
}
#define X(stream) \
- void add_ ## stream ## _with_delim(char *delim, char *txt, \
+ void add_ ## stream ## _with_delim(const char *delim, \
+ const char *txt, \
va_list args) { \
char tmp[STR_L]; \
vsprintf(tmp, txt, args); \
@@ -56,22 +57,22 @@ void log_command(int argc, char* argv[]) {
CK_STREAMS
#undef X
-#define X(stream) \
- void ck## stream(char *txt, ...) { \
- va_list args; \
- va_start(args, txt); \
- add_## stream ##_with_delim("\n", txt, args); \
- va_end(args); \
+#define X(stream) \
+ void ck## stream(const char *txt, ...) { \
+ va_list args; \
+ va_start(args, txt); \
+ add_## stream ##_with_delim("\n", txt, args); \
+ va_end(args); \
}
CK_STREAMS
#undef X
-#define X(stream) \
- void ck## stream ##_with_delim(char *d, char *txt, ...) { \
- va_list args; \
- va_start(args, txt); \
- add_## stream ##_with_delim(d, txt, args); \
- va_end(args); \
+#define X(stream) \
+ void ck## stream ##_with_delim(const char *d, const char *txt, ...) { \
+ va_list args; \
+ va_start(args, txt); \
+ add_## stream ##_with_delim(d, txt, args); \
+ va_end(args); \
}
CK_STREAMS
#undef X
@@ -123,7 +124,7 @@ extern void errlog_set_verbose(int level) {
}
-void initialize_errlog(int argc, char* argv[]) {
+void initialize_errlog(int argc, const char** argv) {
#define X(stream) stream = NULL;
CK_STREAMS
#undef X