[FFmpeg-cvslog] r22946 - trunk/libavutil/log.c

Måns Rullgård mans
Fri Apr 23 12:18:18 CEST 2010


Michael Niedermayer <michaelni at gmx.at> writes:

> On Fri, Apr 23, 2010 at 12:56:16AM +0200, James Darnley wrote:
>> On 23 April 2010 00:41, Michael Niedermayer <michaelni at gmx.at> wrote:
>> > i think this could be done with fewer ifdefs
>> 
>> Thy will be done.
>> Removed 1, now has 1 duplicated line.  I also changed the colours
>> table to force the colours to be bright and then only use bright on
>> the others if they were already
>
>>  log.c |   25 +++++++++++++++++++++++++
>>  1 file changed, 25 insertions(+)
>> 1f3afbe1891ed823108f9c593e538ef004661724  colours.diff
>> Index: libavutil/log.c
>> ===================================================================
>> --- libavutil/log.c	(revision 22948)
>> +++ libavutil/log.c	(working copy)
>> @@ -24,7 +24,11 @@
>>   * logging functions
>>   */
>>  
>> +#ifdef _WIN32
>> +#include <windows.h>
>> +#else
>>  #include <unistd.h>
>> +#endif
>
> unistd.h needs to be under ifdef?
>
>>  #include "avutil.h"
>>  #include "log.h"
>>  
>> @@ -39,6 +43,26 @@
>>  
>>  #undef fprintf
>>  static void colored_fputs(int color, const char *str){
>> +#ifdef _WIN32

This will probably break badly running in xterm on cygwin.

>> +    int win_color_conv[] = { 0,
>> +                             FOREGROUND_RED|FOREGROUND_INTENSITY,
>> +                             FOREGROUND_GREEN|FOREGROUND_INTENSITY,
>> +                             FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_INTENSITY,
>> +                             FOREGROUND_BLUE|FOREGROUND_INTENSITY,
>> +                             FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_INTENSITY,
>> +                             FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_INTENSITY,
>> +                             FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE,
>> +                             FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE,
>> +                             FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE };
>
> these could be vertically aligned

A newline before the first 0 and normal indentation on those lines
would be nice too.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-cvslog mailing list