diff options
author | Max Horn | 2009-02-15 22:28:50 +0000 |
---|---|---|
committer | Max Horn | 2009-02-15 22:28:50 +0000 |
commit | 5ecfecd3bc795446581186eb7f0e04b1c0caa0e3 (patch) | |
tree | c69aa304b273dd26c3226c7d25be9890c163b886 /engines/sci/scicore/console.cpp | |
parent | 57434d955fc6eaa77ab1ef5c408f733a59dabbcf (diff) | |
download | scummvm-rg350-5ecfecd3bc795446581186eb7f0e04b1c0caa0e3.tar.gz scummvm-rg350-5ecfecd3bc795446581186eb7f0e04b1c0caa0e3.tar.bz2 scummvm-rg350-5ecfecd3bc795446581186eb7f0e04b1c0caa0e3.zip |
SCI: Run astyle to make the code be more compliant with our Code Formatting Guidelines: scicore dir
svn-id: r38318
Diffstat (limited to 'engines/sci/scicore/console.cpp')
-rw-r--r-- | engines/sci/scicore/console.cpp | 75 |
1 files changed, 33 insertions, 42 deletions
diff --git a/engines/sci/scicore/console.cpp b/engines/sci/scicore/console.cpp index 4bb45160b5..ab53240634 100644 --- a/engines/sci/scicore/console.cpp +++ b/engines/sci/scicore/console.cpp @@ -44,12 +44,11 @@ static void (*_con_pixmap_callback)(gfx_pixmap_t *) = NULL; int -sciprintf (const char *fmt, ...) -{ +sciprintf(const char *fmt, ...) { va_list argp; size_t bufsize = 256; unsigned int i; - char *buf = (char *) sci_malloc (bufsize); + char *buf = (char *) sci_malloc(bufsize); if (NULL == fmt) { fprintf(stderr, "console.c: sciprintf(): NULL passed for parameter fmt\n"); @@ -61,24 +60,24 @@ sciprintf (const char *fmt, ...) return -1; } - va_start (argp, fmt); - while ((i = vsnprintf (buf, bufsize - 1, fmt, argp)) == -1 - || (i >= bufsize - 2)) { + va_start(argp, fmt); + while ((i = vsnprintf(buf, bufsize - 1, fmt, argp)) == -1 + || (i >= bufsize - 2)) { /* while we're out of space... */ - va_end (argp); - va_start (argp, fmt); /* reset argp */ + va_end(argp); + va_start(argp, fmt); /* reset argp */ - free (buf); - buf = (char *) sci_malloc (bufsize <<= 1); + free(buf); + buf = (char *) sci_malloc(bufsize <<= 1); } - va_end (argp); + va_end(argp); if (con_passthrough) - printf ("%s", buf); + printf("%s", buf); if (con_file) - fprintf (con_file, "%s", buf); + fprintf(con_file, "%s", buf); + - if (_con_string_callback) _con_string_callback(buf); else @@ -88,26 +87,22 @@ sciprintf (const char *fmt, ...) } void -con_set_string_callback(void(*callback)(char *)) -{ +con_set_string_callback(void(*callback)(char *)) { _con_string_callback = callback; } void -con_set_pixmap_callback(void(*callback)(gfx_pixmap_t *)) -{ +con_set_pixmap_callback(void(*callback)(gfx_pixmap_t *)) { _con_pixmap_callback = callback; } int -con_can_handle_pixmaps(void) -{ +con_can_handle_pixmaps(void) { return _con_pixmap_callback != NULL; } int -con_insert_pixmap(gfx_pixmap_t *pixmap) -{ +con_insert_pixmap(gfx_pixmap_t *pixmap) { if (_con_pixmap_callback) _con_pixmap_callback(pixmap); else @@ -117,34 +112,30 @@ con_insert_pixmap(gfx_pixmap_t *pixmap) void -open_console_file (char *filename) -{ - if (con_file != NULL) - fclose (con_file); - - if (NULL == filename) - { - fprintf(stderr, "console.c: open_console_file(): NULL passed for parameter filename\r\n"); - } +open_console_file(char *filename) { + if (con_file != NULL) + fclose(con_file); + + if (NULL == filename) { + fprintf(stderr, "console.c: open_console_file(): NULL passed for parameter filename\r\n"); + } #ifdef WIN32 - con_file = fopen (filename, "wt"); + con_file = fopen(filename, "wt"); #else - con_file = fopen (filename, "w"); + con_file = fopen(filename, "w"); #endif - if (NULL == con_file) - fprintf(stderr, "console.c: open_console_file(): Could not open output file %s\n", filename); + if (NULL == con_file) + fprintf(stderr, "console.c: open_console_file(): Could not open output file %s\n", filename); } void -close_console_file (void) -{ - if (con_file != NULL) - { - fclose (con_file); - con_file = NULL; - } +close_console_file(void) { + if (con_file != NULL) { + fclose(con_file); + con_file = NULL; + } } |