From: hackbard Date: Sun, 1 Aug 2004 18:42:41 +0000 (+0000) Subject: corrected stderr output X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea939060d8c1df6b3de0b3204a0b5b06018ee8da;p=my-code%2Fapi.git corrected stderr output --- diff --git a/audio/audio.c b/audio/audio.c index 57eb6d8..7bacdac 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -8,7 +8,7 @@ int audio_init(t_audio *audio) { - fprintf(stderr,"[audio] initializing audio ..."); + fprintf(stderr,"[audio] initializing audio ...\n"); if((audio->dsp_fd=open(audio->dsp_dev,O_RDWR))==-1) { perror("[audio] open call"); @@ -21,7 +21,7 @@ int audio_init(t_audio *audio) { } if(!(audio->dsp_cap&DSP_CAP_DUPLEX)) { - fprintf(stderr,"[audio] no duplex support"); + fprintf(stderr,"[audio] no duplex support\n"); return A_ERROR; } @@ -32,7 +32,7 @@ int audio_setup(t_audio *audio) { int tmp; - fprintf(stderr,"[audio] setting up sound device & allocating record/playback buffer"); + fprintf(stderr,"[audio] setting up sound device & allocating record/playback buffer\n"); tmp=audio->fmt; if(ioctl(audio->dsp_fd,SNDCTL_DSP_SETFMT,&tmp)==-1) { @@ -40,7 +40,7 @@ int audio_setup(t_audio *audio) { return A_ERROR; } if(tmp!=audio->fmt) { - fprintf(stderr,"[audio] FMT not supported"); + fprintf(stderr,"[audio] FMT not supported\n"); return A_ERROR; } @@ -50,7 +50,7 @@ int audio_setup(t_audio *audio) { return A_ERROR; } if(tmp!=audio->speed) { - fprintf(stderr,"[audio] SPEED not supported"); + fprintf(stderr,"[audio] SPEED not supported\n"); return A_ERROR; } @@ -73,7 +73,7 @@ int audio_setup(t_audio *audio) { int audio_shutdown(t_audio *audio) { - fprintf(stderr,"[audio] shutdown"); + fprintf(stderr,"[audio] shutdown\n"); free(audio->play_data); free(audio->rec_data); diff --git a/display/display.c b/display/display.c index cf09a93..178ec62 100644 --- a/display/display.c +++ b/display/display.c @@ -24,7 +24,7 @@ int display_init(t_display *display) { ,ws.ws_col,ws.ws_row); /* allocating 'screen' buffer */ - if((display->screen=(unsigned char *)malloc(display->max_x*display->max_y)) + if((display->screen=(char *)malloc(display->max_x*display->max_y)) ==NULL) { perror("[display] malloc call"); return D_ERROR; @@ -110,7 +110,7 @@ int display_shutdown(t_display *display) { free(display->screen); - fprintf(stderr,"[display] shutdown"); + fprintf(stderr,"[display] shutdown\n"); return D_SUCCESS; } diff --git a/display/display.h b/display/display.h index 29cf6c9..2184e15 100644 --- a/display/display.h +++ b/display/display.h @@ -22,7 +22,7 @@ typedef struct s_display { int max_x; int max_y; - unsigned char *screen; + char *screen; } t_display; /* function prototypes */ diff --git a/event/event.c b/event/event.c index 748ea83..9a1b6f9 100644 --- a/event/event.c +++ b/event/event.c @@ -8,7 +8,7 @@ int event_init(t_event *event) { - fprintf(stderr,"[event] initializing event system ..."); + fprintf(stderr,"[event] initializing event system ...\n"); event->maxfd=0; @@ -63,14 +63,14 @@ int event_start(t_event *event,void *ptr, if(s_ret) { /* 1+ fd(s) available for reading/writing */ if(callback0(event,ptr)==CALLBACK_ERROR) { - fprintf(stderr,"[event] callback0 returned error"); + fprintf(stderr,"[event] callback0 returned error\n"); return E_ERROR; } } /* usual stuff to be executed */ if(callback1(event,ptr)==CALLBACK_ERROR) { - fprintf(stderr,"[event] callback returned error"); + fprintf(stderr,"[event] callback returned error\n"); return E_ERROR; } @@ -81,7 +81,7 @@ int event_start(t_event *event,void *ptr, int event_stop(t_event *event) { - fprintf(stderr,"[event] shutdown"); + fprintf(stderr,"[event] shutdown\n"); event->status=DISABLED; return E_SUCCESS; diff --git a/input/input.c b/input/input.c index c734a5b..8996866 100644 --- a/input/input.c +++ b/input/input.c @@ -11,7 +11,7 @@ int input_init(t_input *input) { struct termios tios; int size; - fprintf(stderr,"[input] initializing input system ..."); + fprintf(stderr,"[input] initializing input system ...\n"); size=((input->mode&CONTENT_BUFFER)?MAX_CONTENT:1); @@ -44,7 +44,7 @@ int input_shutdown(t_input *input) { free(input->content); tcsetattr(0,TCSANOW,&(input->tios)); - fprintf(stderr,"[input] shutdown"); + fprintf(stderr,"[input] shutdown\n"); return I_SUCCESS; } @@ -64,7 +64,7 @@ int input_get_event(t_input *input,int (*callback)(t_input *input,void *ptr), } if(input->c_count>=MAX_CONTENT) { - fprintf(stderr,"[input] max input length reached"); + fprintf(stderr,"[input] max input length reached\n"); return I_ERROR; } diff --git a/network/network.c b/network/network.c index 2bd7ce3..4cb539d 100644 --- a/network/network.c +++ b/network/network.c @@ -11,7 +11,7 @@ int network_init(t_net *net) { struct sockaddr_in addr; int true; - fprintf(stderr,"[network] initializing network ..."); + fprintf(stderr,"[network] initializing network ...\n"); memset(net->connection,0,MAX_CONNECTIONS*sizeof(t_connection)); net->c_count=0; @@ -35,7 +35,7 @@ int network_init(t_net *net) { perror("[network] setsockopt call"); return N_ERROR; } - fprintf(stderr,"[network] reused address"); + fprintf(stderr,"[network] reused address\n"); } if(listen(net->l_fd,MAX_LISTEN_QUEUE)==-1) { @@ -62,7 +62,7 @@ int network_shutdown(t_net *net) { return N_ERROR; } - fprintf(stderr,"[network] shutdown"); + fprintf(stderr,"[network] shutdown\n"); return N_SUCCESS; } @@ -231,7 +231,7 @@ int network_manage_incoming(t_net *net) { } } - fprintf(stderr,"[network] maximum connections reached"); + fprintf(stderr,"[network] maximum connections reached\n"); return N_E_MAXC; } @@ -287,7 +287,7 @@ int network_udp_listen_init(t_net *net) { perror("[network] setsockopt call (udp)"); return N_ERROR; } - fprintf(stderr,"[network] reused address (udp)"); + fprintf(stderr,"[network] reused address (udp)\n"); } fprintf(stderr,"[network] listening on port %d (udp)\n",net->l_udp_port);