Changeset 4300


Ignore:
Timestamp:
Jan 24, 2010, 10:58:17 PM (7 years ago)
Author:
sam
Message:

Fix the source code to reduce testsuite errors.

Location:
libcaca/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/codec/export.c

    r4299 r4300  
    993993static uint8_t _rgb_to_troff_index(uint32_t color)
    994994{
    995         int i;
    996         uint8_t r = 0;
    997         for(i = 0; i < 3; i++)
    998         {
    999                 r += ((color >> (8*i+7))&1) << i;
    1000         }
    1001         return r;
     995    int i;
     996    uint8_t r = 0;
     997    for(i = 0; i < 3; i++)
     998        r += ((color >> (8 * i + 7)) & 1) << i;
     999
     1000    return r;
    10021001}
    10031002
     
    10151014    int started = 0;
    10161015
    1017     /* Each char is at most 
     1016    /* Each char is at most
    10181017     *  2x\mM (2x10)
    10191018     *  + \fB + \fI + \fR (9)
     
    10381037        for(x = 0; x < cv->width; x++)
    10391038        {
    1040             uint32_t fg = _rgb_to_troff_index(_caca_attr_to_rgb24fg(lineattr[x]));
    1041             uint32_t bg = _rgb_to_troff_index(_caca_attr_to_rgb24bg(lineattr[x]));
    1042             uint32_t ch = linechar[x];
    1043 
    1044             if(fg != prevfg || !started)
    1045                 cur += sprintf(cur, "\\m[%s]", colors[fg]);
    1046             if(bg != prevbg || !started)
    1047                 cur += sprintf(cur, "\\M[%s]", colors[bg]);
     1039            uint32_t fg = _rgb_to_troff_index(_caca_attr_to_rgb24fg(lineattr[x]));
     1040            uint32_t bg = _rgb_to_troff_index(_caca_attr_to_rgb24bg(lineattr[x]));
     1041            uint32_t ch = linechar[x];
     1042
     1043            if(fg != prevfg || !started)
     1044                cur += sprintf(cur, "\\m[%s]", colors[fg]);
     1045            if(bg != prevbg || !started)
     1046                cur += sprintf(cur, "\\M[%s]", colors[bg]);
    10481047            if(lineattr[x] & CACA_BOLD)
    10491048                cur += sprintf(cur, "\\fB");
     
    10621061            prevbg = bg;
    10631062            started = 1;
    1064         }
     1063        }
    10651064
    10661065        /* Add unbreakable space at the end of lines, else spaces are dropped */
  • libcaca/trunk/doc

    • Property svn:ignore
      •  

        old new  
        22Makefile.in
        33doxygen.cfg
         4doxygen.log
        45man
        56html
  • libcaca/trunk/examples

    • Property svn:ignore
      •  

        old new  
        33.libs
        44.deps
         5blit
         6canvas
         7colors
         8conio
         9conio-snake
         10demo
         11demo0
         12dithering
         13driver
         14event
         15export
         16figfont
         17font
         18font2tga
         19frames
         20fullwidth
         21gamma
        522hsv
        623import
        7 canvas
        8 export
        9 gamma
         24input
         25mouse
         26spritedit
         27swallow
         28text
         29transform
         30trifiller
         31truecolor
        1032unicode
        11 figfont
        12 demo0
        13 transform
        14 dithering
        15 event
        16 colors
        17 font
        18 spritedit
        19 frames
        20 truecolor
        21 font2tga
        22 text
        23 demo
        24 swallow
        25 blit
        26 driver
        27 input
        28 fullwidth
        29 conio
        30 conio-snake
        3133*.exe
        3234*.user
  • libcaca/trunk/java

    • Property svn:ignore set to
      Makefile.in
      Makefile
      .libs
      .deps
      *.a
  • libcaca/trunk/kernel/Makefile.am

    r4298 r4300  
    2121        rm -f bootsect.bin kern.bin kernel.map
    2222
     23echo-sources: ; echo $(SOURCES)
     24
  • libcaca/trunk/kernel/kernel.c

    r4160 r4300  
    11/*
    2  *  libcaca       
     2 *  libcaca
    33 *  libcaca       Colour ASCII-Art library
    44 *  Copyright (c) 2006 Sam Hocevar <sam@hocevar.net>
     
    3535    struct processor_info processor_info;
    3636    struct floppy_info    floppy_info;
    37    
     37
    3838    printf("_start at 0x%x\n", _start);
    3939    printf("kmain() at 0x%x\n", kmain);
    4040    printf("Types : char[%d] short[%d] int[%d] unsigned long long[%d]\n", sizeof(char), sizeof(short), sizeof(int), sizeof(unsigned long long));
    41    
     41
    4242    enable_interrupt(1);  // Enable Keyboard Interrupt (IRQ1)
    4343    enable_interrupt(0);  // Enable IRQ0 (timer)
    4444    enable_interrupt(13);
    4545    timer_phase(100);     // Fire IRQ0 each 1/100s
    46    
    47    
     46
     47
    4848    processor_get_info(&processor_info);
    4949    processor_print_info(&processor_info);
     
    5454    /* Caca is delicious */
    5555    printf("Filling memory with 0xCACA, starting from 0x%x\n", end);
    56    
     56
    5757    char *ptr = end;
    5858    while (1)
  • libcaca/trunk/kernel/kernel.h

    r4159 r4300  
    11/*
    2  *  libcaca       
     2 *  libcaca
    33 *  libcaca       Colour ASCII-Art library
    44 *  Copyright (c) 2006 Sam Hocevar <sam@hocevar.net>
     
    2727void enable_interrupt(char i);
    2828
     29#define cli __asm__("cli" : : )
     30#define sti __asm__("sti" : : )
    2931
    30 #define cli             __asm__("cli"::)
    31 #define sti             __asm__("sti"::)
    32 
    33 #define rdtsc(low,high) \
    34 __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high))
    35 
     32#define rdtsc(low, high) \
     33    __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high))
    3634
    3735/* The application's entry point */
  • libcaca/trunk/kernel/klibc.h

    • Property svn:executable deleted
  • libcaca/trunk/kernel/multiboot.h

    r568 r4300  
    11/* multiboot.h - the header for Multiboot */
    22/* Copyright (C) 1999  Free Software Foundation, Inc.
    3    
     3
    44   This program is free software; you can redistribute it and/or modify
    55   it under the terms of the GNU General Public License as published by
    66   the Free Software Foundation; either version 2 of the License, or
    77   (at your option) any later version.
    8    
     8
    99   This program is distributed in the hope that it will be useful,
    1010   but WITHOUT ANY WARRANTY; without even the implied warranty of
    1111   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1212   GNU General Public License for more details.
    13    
     13
    1414   You should have received a copy of the GNU General Public License
    1515   along with this program; if not, write to the Free Software
     
    1919
    2020/* The magic number for the Multiboot header.  */
    21 #define MULTIBOOT_HEADER_MAGIC          0x1BADB002
     21#define MULTIBOOT_HEADER_MAGIC 0x1BADB002
    2222
    2323/* The flags for the Multiboot header.  */
    24 #define MULTIBOOT_HEADER_FLAGS          0x00010003
     24#define MULTIBOOT_HEADER_FLAGS 0x00010003
    2525
    2626/* The magic number passed by a Multiboot-compliant boot loader.  */
    27 #define MULTIBOOT_BOOTLOADER_MAGIC      0x2BADB002
     27#define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002
    2828
    2929/* The size of our stack (16KB).  */
    30 #define STACK_SIZE                      0x4000
     30#define STACK_SIZE 0x4000
    3131
    3232/* C symbol format. HAVE_ASM_USCORE is defined by configure.  */
    3333#ifdef HAVE_ASM_USCORE
    34 # define EXT_C(sym)                     _ ## sym
     34# define EXT_C(sym) _ ## sym
    3535#else
    36 # define EXT_C(sym)                     sym
     36# define EXT_C(sym) sym
    3737#endif
    3838
  • libcaca/trunk/test/check-build

    r4297 r4300  
    2828#
    2929failure=0
    30 for dir in caca src cxx examples ruby tools; do
     30for dir in caca kernel src cxx examples ruby tools; do
    3131  pushd ../$dir >/dev/null
    3232  for x in $(make -s echo-sources); do
     
    5757warnings="$(grep -c Warning: ../doc/doxygen.log)"
    5858if test "$warnings" != "0"; then
    59   echo "error: $warnings warnings in Doxygen generation"
     59  echo "error: $warnings warnings in Doxygen generation:"
     60  grep Warning: ../doc/doxygen.log | sed 's/\(.\{75\}\)...*/\1 .../'
    6061  ret=1
    6162else
  • libcaca/trunk/win32/config.h

    r3908 r4300  
    2626/* #undef HAVE_INTTYPES_H */
    2727/* #undef HAVE_IOCTL */
     28/* #undef HAVE_JNI_H */
    2829/* #undef HAVE_LOCALE_H */
    2930#define HAVE_MEMORY_H 1
Note: See TracChangeset for help on using the changeset viewer.