Changeset 933 for trunk/serial.c


Ignore:
Timestamp:
03/13/10 18:28:29 (2 years ago)
Author:
uwe
Message:

Various coding style and cosmetic changes (trivial).

  • Fix coding-style, whitespace, and indentation in a few places.
  • Consistently use the same spelling ("Super I/O") everywhere.
  • Make some flashrom stdout output look a bit nicer.


Signed-off-by: Uwe Hermann <uwe@…>
Acked-by: Uwe Hermann <uwe@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/serial.c

    r883 r933  
    106106#ifdef _WIN32 
    107107        HANDLE fd; 
    108         char* dev2 = dev; 
    109         if ((strlen(dev) > 3) && (tolower(dev[0])=='c') && (tolower(dev[1])=='o') && (tolower(dev[2])=='m')) { 
    110                 dev2 = malloc(strlen(dev)+5); 
     108        char *dev2 = dev; 
     109        if ((strlen(dev) > 3) && (tolower(dev[0]) == 'c') 
     110            && (tolower(dev[1]) == 'o') && (tolower(dev[2]) == 'm')) { 
     111                dev2 = malloc(strlen(dev) + 5); 
    111112                strcpy(dev2, "\\\\.\\"); 
    112                 strcpy(dev2+4, dev); 
    113         } 
    114         fd = CreateFile(dev2, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); 
     113                strcpy(dev2 + 4, dev); 
     114        } 
     115        fd = CreateFile(dev2, GENERIC_READ | GENERIC_WRITE, 0, NULL, 
     116                        OPEN_EXISTING, 0, NULL); 
    115117        if (dev2 != dev) 
    116118                free(dev2); 
     
    130132                default: sp_die("Error: Could not set baud rate"); 
    131133        } 
    132         dcb.ByteSize=8; 
    133         dcb.Parity=NOPARITY; 
    134         dcb.StopBits=ONESTOPBIT; 
     134        dcb.ByteSize = 8; 
     135        dcb.Parity = NOPARITY; 
     136        dcb.StopBits = ONESTOPBIT; 
    135137        if (!SetCommState(fd, &dcb)) { 
    136138                sp_die("Error: Could not change serial port configuration"); 
     
    148150                if (sp_baudtable[i].baud == 0) { 
    149151                        close(fd); 
    150                         msg_perr( 
    151                                 "Error: cannot configure for baudrate %d\n", 
    152                                 baud); 
     152                        msg_perr("Error: cannot configure for baudrate %d\n", 
     153                                 baud); 
    153154                        exit(1); 
    154155                } 
Note: See TracChangeset for help on using the changeset viewer.