Stefan Reinauer (stefan.reinauer@coreboot.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14606
-gerrit
commit ccd7737847c7d2104c0fea30b6a411f7e3e56a4f Author: Stefan Reinauer stefan.reinauer@coreboot.org Date: Wed May 4 12:46:11 2016 -0700
Remove white space at the end of lines
Change-Id: Iacf45f0eec3c59d13c3ad0db425edbc01eb1fce5 Signed-off-by: Stefan Reinauer stefan.reinauer@coreboot.org --- Documentation/CHANGES | 2 +- Documentation/FAQ | 2 +- Documentation/TODO | 12 +- Kconfig | 8 +- Makefile | 4 +- README | 30 +- arm/elf.c | 2 +- build.sh | 4 +- drivers/Makefile.inc | 4 +- drivers/flash/Makefile.inc | 4 +- drivers/flash/lxflash.c | 72 ++--- drivers/flash/lxflash.h | 8 +- drivers/ide.c | 68 ++--- drivers/ide_new.c | 12 +- drivers/intel.c | 4 +- fs/Makefile.inc | 4 +- fs/filesys.h | 10 +- fs/fsys_aboot.c | 22 +- fs/fsys_cramfs.c | 40 +-- fs/fsys_ext2fs.c | 44 +-- fs/fsys_fat.c | 158 +++++----- fs/fsys_iso9660.c | 2 +- fs/fsys_jfs.c | 6 +- fs/fsys_minix.c | 20 +- fs/fsys_reiserfs.c | 250 +++++++-------- fs/fsys_squashfs.c | 4 +- fs/fsys_xfs.c | 12 +- fs/jfs.h | 42 +-- fs/mini_inflate.c | 80 ++--- fs/mini_inflate.h | 12 +- fs/squashfs_fs.h | 12 +- fs/squashfs_zlib.h | 20 +- fs/xfs.h | 24 +- include/elf_boot.h | 6 +- main/Makefile.inc | 6 +- main/elfload.c | 4 +- main/filo.c | 10 +- main/grub/Makefile.inc | 4 +- main/grub/builtins.c | 6 +- main/grub/grub.c | 6 +- main/ipchecksum.c | 2 +- util/artecimage.c | 6 +- util/kconfig/confdata.c | 2 +- util/kconfig/lex.zconf.c_shipped | 86 +++--- util/kconfig/lxdialog/BIG.FAT.WARNING | 2 +- util/kconfig/lxdialog/menubox.c | 2 +- util/kconfig/regex.c | 556 +++++++++++++++++----------------- util/kconfig/regex.h | 24 +- util/kconfig/zconf.tab.c_shipped | 2 +- x86/Makefile.inc | 4 +- x86/artecboot.c | 42 +-- x86/context.c | 4 +- x86/linux_load.c | 10 +- x86/segment.c | 2 +- x86/switch.S | 8 +- x86/wince_load.c | 16 +- 56 files changed, 904 insertions(+), 904 deletions(-)
diff --git a/Documentation/CHANGES b/Documentation/CHANGES index 9477cf3..e0f78f3 100644 --- a/Documentation/CHANGES +++ b/Documentation/CHANGES @@ -45,7 +45,7 @@ Version 0.5b2 stepan 2006-04-28
Version 0.5b1 stepan 2005-10-01 * Integrate grub user interface - + Version 0.4.2 ts1 2003-10-31 * Added brute force method of PCI scan (turned off by default.) * Workaround for CD drives that report unusual sector size. diff --git a/Documentation/FAQ b/Documentation/FAQ index ed77145..ade38ed 100644 --- a/Documentation/FAQ +++ b/Documentation/FAQ @@ -1,4 +1,4 @@ -Q. My GRUB menu.lst does not work. +Q. My GRUB menu.lst does not work. A. The disks are numbered differently in FILO. They might or might not follow the Linux scheme, depending on the order of driver modules in Linux, etc. hd2,0 is hdc1, not necessarily the third disk (there might be no hdb) diff --git a/Documentation/TODO b/Documentation/TODO index 5ae8bb4..aca294d 100644 --- a/Documentation/TODO +++ b/Documentation/TODO @@ -11,21 +11,21 @@ Cleanup dangerous to plain wrong.
Devices/Drivers - - create a list of all available devices (and search this on for menu.lst + - create a list of all available devices (and search this on for menu.lst or "find" or tab completion) - USB keyboard/Serial support - Full & tested USB support - + CD/DVD Boot support - gather syslinux config files from CDs/DVDs and add their entries - to the menu. (Create a menu if syslinux config files are found + to the menu. (Create a menu if syslinux config files are found but no menu.lst)
SCSI - yeah, scsi support, good point. This is an open issue in LinuxBIOS for now. Int13 support somehow? http://cvs.sourceforge.net/viewcvs.py/u-boot/u-boot/board/MAI/bios_emulator/ - + Config File Support
- search for a menu.lst rather than hardcoding it?!? @@ -38,5 +38,5 @@ Config File Support
- We can have an entry in hard disk's filo.cfg to boot from CD-ROM. If this entry is selected, filo.cfg from CD-ROM is read. - - + + diff --git a/Kconfig b/Kconfig index 90fa2f4..c8eadd9 100644 --- a/Kconfig +++ b/Kconfig @@ -58,7 +58,7 @@ config MENULST_FILE help For VIA Epia-MII CF use: hde1:/boot/filo/menu.lst - + config MENULST_TIMEOUT int "Timeout for loading menu.lst" default 0 @@ -121,9 +121,9 @@ config IDE_DISK_POLL_DELAY default 0 depends on IDE_DISK help - Add a short delay when polling status registers + Add a short delay when polling status registers (required on some broken SATA controllers) - NOTE: Slows down access significantly, so disable + NOTE: Slows down access significantly, so disable whenever possible. Set to 1 if you require this.
config SLOW_SATA @@ -134,7 +134,7 @@ config SLOW_SATA SATA drives seem to have problems reporting their spinup. This will delay FILO start by 5s so the disks have some time to settle. (required on some broken SATA controllers) - NOTE: Slows down access significantly, so disable + NOTE: Slows down access significantly, so disable whenever possible.
config PCMCIA_CF diff --git a/Makefile b/Makefile index a3689b2..d8bf286 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # -# Copyright (C) 2008-2009 by coresystems GmbH -# +# Copyright (C) 2008-2009 by coresystems GmbH +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or diff --git a/README b/README index 5768154..d081215 100644 --- a/README +++ b/README @@ -26,15 +26,15 @@ REQUIREMENTS Only i386 PC architecture is currently supported.
x86-64 (AMD 64) machines in 32-bit mode do also work. - (coreboot uses 32-bit mode and the Linux kernel does the + (coreboot uses 32-bit mode and the Linux kernel does the transition to 64-bit mode)
I'm using an AMD64 based mainboard with IDE hard disk - and a DVD drive for testing, and QEmu, Bochs or VMware + and a DVD drive for testing, and QEmu, Bochs or VMware for development.
Recent version of GNU toolchain is required to build. - I have tested with the toolchains from SUSE 10.0 and SUSE 10.1, + I have tested with the toolchains from SUSE 10.0 and SUSE 10.1, but slightly older versions might also work.
INSTALL @@ -70,17 +70,17 @@ NOTES
If you are using the GRUB like frontend:
- - make sure you adapt your menu.lst path - - if you want to use FILO over a serial connection, make sure you have + - make sure you adapt your menu.lst path + - if you want to use FILO over a serial connection, make sure you have something like this in your menu.lst file:
serial --unit=0 --speed=115200 terminal serial console - + USING
When FILO starts, it displays "boot:" prompt or the GRUB menu interface. - + At "boot:" prompt, type the name of your boot image, and optionally the kernel parameter, in the form: DEVICE:FILENAME[ PARAM] @@ -88,7 +88,7 @@ USING boot: hda1:/vmlinuz root=/dev/hda1
Notation of DEVICE for IDE disk and CD-ROM is same as in Linux - (eg. hda1 means the first partition of master device on primary + (eg. hda1 means the first partition of master device on primary IDE channel). Support for El Torito bootable CD-ROM, "hdc1" means the boot disk image of the CD-ROM at hdc.
@@ -138,24 +138,24 @@ USB
USB support is originally taken from Steven James's baremetal in coreboot-v1 util. - - Yinghai Lu seperated common functions from uhci.c to usb.c and + + Yinghai Lu seperated common functions from uhci.c to usb.c and created ohci.c to support ohci. ohci.c is heavily inspired by Linux Kernel 2.4.22 drivers/usb/host/usb-ohci.c. - + Stefan Reinauer integrated USB back into the main filo version. - + USB support includes several parts 1. UHCI+OHCI--->USB: provides usb init, usb_control_msg and usb_bulk_msg interface - 2. USB_SCSI: bulk only device + 2. USB_SCSI: bulk only device 3. USB_X interface to FILO - + todo: - EHCI support
BUG REPORTING
- If you have problem with FILO, set DEBUG_ALL in Config and send its + If you have problem with FILO, set DEBUG_ALL in Config and send its console output to the coreboot mailinglist at coreboot@coreboot.org.
ACKNOWLEDGEMENTS diff --git a/arm/elf.c b/arm/elf.c index 5db5227..87e1188 100644 --- a/arm/elf.c +++ b/arm/elf.c @@ -24,6 +24,6 @@ void relocate(void)
u32 start_elf(u32 entry_point, u32 param) { - // Not supported + // Not supported return 0; } diff --git a/build.sh b/build.sh index c2bcbdc..93ee268 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,6 @@ #!/bin/bash
-if [ "$1" == "" ]; then +if [ "$1" == "" ]; then CONFIG=defconfig fi
@@ -23,7 +23,7 @@ $MAKE distclean cd ../coreboot/payloads/libpayload $MAKE distclean build_with_config $CONFIG -$MAKE DESTDIR=$FILO/build install +$MAKE DESTDIR=$FILO/build install cd $FILO build_with_config $CONFIG
diff --git a/drivers/Makefile.inc b/drivers/Makefile.inc index 941c151..dc3bbb1 100644 --- a/drivers/Makefile.inc +++ b/drivers/Makefile.inc @@ -1,6 +1,6 @@ # -# Copyright (C) 2008 by coresystems GmbH -# +# Copyright (C) 2008 by coresystems GmbH +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or diff --git a/drivers/flash/Makefile.inc b/drivers/flash/Makefile.inc index 48bf1a1..cbffb23 100644 --- a/drivers/flash/Makefile.inc +++ b/drivers/flash/Makefile.inc @@ -1,6 +1,6 @@ # -# Copyright (C) 2008 by coresystems GmbH -# +# Copyright (C) 2008 by coresystems GmbH +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or diff --git a/drivers/flash/lxflash.c b/drivers/flash/lxflash.c index df18c8d..9511e39 100644 --- a/drivers/flash/lxflash.c +++ b/drivers/flash/lxflash.c @@ -332,7 +332,7 @@ static void NAND_readData(u8 *pData, int nSize)
if(nSize > 528) return; // oversized buffer?
- // read from port mapped registers, + // read from port mapped registers, for(i=0; i<nDwords; i++) ((u32*)pData)[i] = inl(g_baseAddr + IO_NAND_DATA);
@@ -429,7 +429,7 @@ int NAND_isBlockBad(u32 blockID)
// Get the first page of the block u32 dwPageID = blockID * g_flashInfo.pagesPerBlock; - + // for 512-byte page size, use the original addressing scheme if(g_flashInfo.dataBytesPerPage == PAGE_SIZE_512) { @@ -462,7 +462,7 @@ int NAND_isBlockBad(u32 blockID)
// Check the first page. NAND_writeCTL(CS_NAND_CTL_CLE); // latch command - + if(g_flashInfo.dataBytesPerPage == PAGE_SIZE_2048) NAND_writeIO(CMD_READ); // send read command else NAND_writeIO(CMD_READ2); // send read command 2 @@ -476,7 +476,7 @@ int NAND_isBlockBad(u32 blockID) NAND_writeIO(pa2); // send Page Address 2 NAND_writeIO(pa3); // send Page Address 3 NAND_writeCTL(0x00); // select chip - + if(g_flashInfo.dataBytesPerPage == PAGE_SIZE_2048) { NAND_writeCTL(CS_NAND_CTL_CLE); // latch command @@ -509,7 +509,7 @@ __inline int IsECCWritten(u8 *pECC) }
//////////////////////////////////////////////////////////////////////////////// -// +//
void NAND_close(void) { @@ -518,7 +518,7 @@ void NAND_close(void) }
//////////////////////////////////////////////////////////////////////////////// -// +//
int NAND_initChip(int chipNum) { @@ -526,31 +526,31 @@ int NAND_initChip(int chipNum)
if (g_chipID == chipNum) return 0; if (g_chipID != -1) NAND_close(); - + memset(&g_flashInfo, 0, sizeof(g_flashInfo));
g_chipID = -1;
/////////////////////////////////////////////////////////////////////////////////// // init the MSR_DIVIL_BALL_OPTS register, enable flash mode - + msr = rdmsr(MSR_DIVIL_BALL_OPTS); - + if (msr.lo & PIN_OPT_IDE) { printf("NAND controller not enabled!\n"); return -1; } - + /////////////////////////////////////////////////////////////////////////////////// // init the MSR_DIVIL_LBAR_FLSHx register, I/O mapped mode, set a hardcoded base address // Later we restore initial state - + g_orig_flsh = rdmsr(MSR_DIVIL_LBAR_FLSH0 + chipNum); if (!(g_orig_flsh.hi & NOR_NAND)) { printf("CS%d set up for NOR, aborting!\n", chipNum); return -1; } - + msr.hi = SET_FLSH_HIGH; msr.lo = SET_FLSH_LOW; wrmsr(MSR_DIVIL_LBAR_FLSH0 + chipNum, msr); @@ -562,12 +562,12 @@ int NAND_initChip(int chipNum)
// read out flash chip ID g_deviceID = NAND_readFlashID(); - + switch(g_deviceID) // allow only known flash chips { case SAMSUNG_NAND_64MB: case ST_NAND_64MB: - + g_flashInfo.numBlocks = 4096; g_flashInfo.pagesPerBlock = 32; g_flashInfo.dataBytesPerPage = 512; @@ -582,14 +582,14 @@ int NAND_initChip(int chipNum) g_flashInfo.pagesPerBlock = 64; g_flashInfo.dataBytesPerPage = 2048; g_flashInfo.flashType = FLASH_NAND; - + case ST_NAND_512MB:
g_flashInfo.numBlocks = 4096; g_flashInfo.pagesPerBlock = 64; g_flashInfo.dataBytesPerPage = 2048; g_flashInfo.flashType = FLASH_NAND; - + break;
default: @@ -610,7 +610,7 @@ int NAND_initChip(int chipNum) memset(g_pBBT, BLOCK_UNKNOWN, g_flashInfo.numBlocks);
g_chipID = chipNum; - + printf("Geode LX flash driver initialized, device ID 0x%x\n", g_deviceID); debug("FlashChip = 0x%x\n", g_chipID); debug("NumBlocks = 0x%x\n", g_flashInfo.numBlocks); @@ -645,10 +645,10 @@ int NAND_readPage(u32 pageAddr, u8 *pPageBuff) u8 addr1 = (u8)(pageAddr & 0xff); u8 addr2 = (u8)((pageAddr >> 8) & 0xff); u8 addr3 = (u8)((pageAddr >> 16) & 0xff); - + u16 eccSize = 0; // total ECC size u32 pageSize = 0; - + NAND_writeCTL(0x00); // enable chip NAND_checkStatus((u32)-1); // check ready
@@ -656,15 +656,15 @@ int NAND_readPage(u32 pageAddr, u8 *pPageBuff) NAND_writeIO(CMD_READ); // send read command NAND_writeCTL(CS_NAND_CTL_ALE); // latch address NAND_writeIO(0x00); // send Column Address 1 - + if(g_flashInfo.dataBytesPerPage == PAGE_SIZE_2048) NAND_writeIO(0x00); // send Column Address 2 - + NAND_writeIO(addr1); // send Page Address 1 NAND_writeIO(addr2); // send Page Address 2 NAND_writeIO(addr3); // send Page Address 3 NAND_writeCTL(0x00); // select chip - + if(g_flashInfo.dataBytesPerPage == PAGE_SIZE_2048) { NAND_writeCTL(CS_NAND_CTL_CLE); // latch command @@ -694,7 +694,7 @@ int NAND_readPage(u32 pageAddr, u8 *pPageBuff) { // Read the ECC info according to Linux MTD format, first part NAND_readData(g_eccTest, 4); - + bBadBlock = NAND_readDataByte(); // bad block byte bReserved = NAND_readDataByte(); // reserved byte // Read the ECC info according to Linux MTD format, second part @@ -708,11 +708,11 @@ int NAND_readPage(u32 pageAddr, u8 *pPageBuff) else if(g_flashInfo.dataBytesPerPage == PAGE_SIZE_2048) { int i; - for(i=0; i<40; i++) NAND_readDataByte(); // skip stuff + for(i=0; i<40; i++) NAND_readDataByte(); // skip stuff // Read the ECC info according to Linux MTD format (2048 byte page) - NAND_readData(g_eccTest, eccSize); + NAND_readData(g_eccTest, eccSize); } - + // test the data integrity; if the data is invalid, attempt to fix it using ECC if(memcmp(g_eccCalc, g_eccTest, eccSize)) { @@ -726,7 +726,7 @@ int NAND_readPage(u32 pageAddr, u8 *pPageBuff) NAND_writeCTL(CS_NAND_CTL_CE); // disable chip return ERROR_NO_ECC; } - + debug("Page data (page 0x%x) is invalid. Attempting ECC to fix it.\n", pageAddr); nRet = NAND_correctData(&pPageBuff[0], &g_eccTest[0], &g_eccCalc[0]); if(nRet == -1) @@ -749,8 +749,8 @@ int NAND_readPage(u32 pageAddr, u8 *pPageBuff) else if(nRet == 0) debug("No errors detected (page 0x%x, second part)\n", pageAddr); else debug("Invalid data (page 0x%x, second part) was corrected using ECC!\n", pageAddr); } - } - else + } + else { debug("Page address [%d] is too large\n", pageAddr); return ERROR_BAD_ADDRESS; @@ -776,14 +776,14 @@ int flash_read(int drive, sector_t sector, void *buffer) int block, nRet; u32 pageAddress = sector * DEV_SECTOR_SIZE / g_flashInfo.dataBytesPerPage; u32 pageOffset = sector * DEV_SECTOR_SIZE % g_flashInfo.dataBytesPerPage; - + // sanity check if(!g_pBBT || !g_flashInfo.pagesPerBlock) { debug("error: NAND not initialized\n"); return -1; } - + // check that the page ID is valid if(pageAddress >= (g_flashInfo.numBlocks * g_flashInfo.pagesPerBlock)) { @@ -794,7 +794,7 @@ int flash_read(int drive, sector_t sector, void *buffer) // get block address block = pageAddress / g_flashInfo.pagesPerBlock;
- debug("drive %d, sector %d -> page %d + %d, buffer 0x%08x\n", + debug("drive %d, sector %d -> page %d + %d, buffer 0x%08x\n", drive, (unsigned int)sector, pageAddress, pageOffset, (unsigned int)buffer);
// get the block status first @@ -805,12 +805,12 @@ int flash_read(int drive, sector_t sector, void *buffer) }
// return failure immediately if the block is bad - if(g_pBBT[block] == BLOCK_BAD) + if(g_pBBT[block] == BLOCK_BAD) { debug("error: block %x is bad\n", block); return -3; } - + // check if we have just read that page if(g_currentPage == pageAddress) { @@ -818,10 +818,10 @@ int flash_read(int drive, sector_t sector, void *buffer) memcpy(buffer, g_pageBuf + pageOffset, DEV_SECTOR_SIZE); return ERROR_SUCCESS; } - + // otherwise proceed with normal reading nRet = NAND_readPage(pageAddress, g_pageBuf); memcpy(buffer, g_pageBuf + pageOffset, DEV_SECTOR_SIZE); - + return nRet; } diff --git a/drivers/flash/lxflash.h b/drivers/flash/lxflash.h index 46a7e25..47ad318 100644 --- a/drivers/flash/lxflash.h +++ b/drivers/flash/lxflash.h @@ -4,7 +4,7 @@ #define TRUE 1 // hmm that's quite obvious :) #define FALSE 0
-typedef struct msr_struct +typedef struct msr_struct { unsigned lo; unsigned hi; @@ -72,7 +72,7 @@ typedef struct _FLASH_INFO // Shift 8 bit to the left to form the correct address for 16bit port // #define VALIDADDR 0x05 -#define OEMADDR 0x04 // 5th byte in spare area +#define OEMADDR 0x04 // 5th byte in spare area
// NAND Flash Command. This appears to be generic across all NAND flash chips
@@ -87,7 +87,7 @@ typedef struct _FLASH_INFO #define CMD_ERASE2 0xd0 // Erase phase 2 #define CMD_STATUS 0x70 // Status read #define CMD_RESET 0xff // Reset -#define CMD_READ_2K 0x30 // Second cycle read cmd for 2KB flash +#define CMD_READ_2K 0x30 // Second cycle read cmd for 2KB flash
// Registers within the NAND flash controller BAR -- memory mapped
@@ -101,7 +101,7 @@ typedef struct _FLASH_INFO #define MM_NAND_LAC 0x814 #define MM_NAND_ECC_CTL 0x815
-// Registers within the NAND flash controller BAR -- I/O mapped +// Registers within the NAND flash controller BAR -- I/O mapped
#define IO_NAND_DATA 0x00 // 0 to 3, in fact #define IO_NAND_CTL 0x04 diff --git a/drivers/ide.c b/drivers/ide.c index e594c64..eab7e88 100644 --- a/drivers/ide.c +++ b/drivers/ide.c @@ -34,24 +34,24 @@
#define BSY_SET_DURING_SPINUP 1 /* - * UBL, The Universal Talkware Boot Loader + * UBL, The Universal Talkware Boot Loader * Copyright (C) 2000 Universal Talkware Inc. * Copyright (C) 2002 Eric Biederman * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * + * (at your option) any later version. + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * + * GNU General Public License for more details. + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * * */ struct controller { @@ -234,9 +234,9 @@ struct ide_pio_command
static unsigned short ide_base[] = { IDE_BASE0, - IDE_BASE1, - IDE_BASE2, - IDE_BASE3, + IDE_BASE1, + IDE_BASE2, + IDE_BASE3, 0 };
@@ -245,7 +245,7 @@ static struct harddisk_info harddisk_info[IDE_MAX_DRIVES];
static unsigned char ide_buffer[IDE_SECTOR_SIZE];
-static int await_ide(int (*done)(struct controller *ctrl), +static int await_ide(int (*done)(struct controller *ctrl), struct controller *ctrl, u64 timeout) { int result; @@ -306,10 +306,10 @@ int select_drive(struct controller *ctrl, int drive) status = inb(IDE_REG_STATUS(ctrl));
mdelay(10); - + device = inb(IDE_REG_DEVICE(ctrl)); status = inb(IDE_REG_STATUS(ctrl)); - + if (device == (0xa0 | (drive<<4))) return 1; else @@ -340,7 +340,7 @@ static int ide_software_reset(struct controller *ctrl) debug("Resetting ide%d... ", ctrl - controllers); /* Disable Interrupts and reset the ide bus */ - outb(IDE_CTRL_HD15 | IDE_CTRL_SRST | IDE_CTRL_NIEN, + outb(IDE_CTRL_HD15 | IDE_CTRL_SRST | IDE_CTRL_NIEN, IDE_REG_DEVICE_CONTROL(ctrl)); /* If BSY bit is not asserted within 400ns, no device there */ if (await_ide(bsy, ctrl, currticks() + IDE_RESET_PULSE) < 0) { @@ -379,7 +379,7 @@ static void pio_set_registers( * The linux ide code suggests 50ms is the right * amount of time to use here. */ - mdelay(50); + mdelay(50); } outb(cmd->feature, IDE_REG_FEATURE(ctrl)); if (cmd->command == IDE_CMD_READ_SECTORS_EXT) { @@ -514,7 +514,7 @@ static inline int ide_read_sector_chs( unsigned int track; unsigned int offset; unsigned int cylinder; - + memset(&cmd, 0, sizeof(cmd)); cmd.sector_count = 1;
@@ -547,7 +547,7 @@ static inline int ide_read_sector_lba( cmd.lba_high = (sector >> 16) & 0xff; cmd.device = IDE_DH_DEFAULT | ((sector >> 24) & 0x0f) | - info->slave | + info->slave | IDE_DH_LBA; cmd.command = IDE_CMD_READ_SECTORS; //debug("%s: sector= %ld, device command= 0x%x.\n",__FUNCTION__,(unsigned long) sector, cmd.device); @@ -668,7 +668,7 @@ static int init_drive(struct harddisk_info *info, struct controller *ctrl, debug("Testing for hd%c\n", 'a'+drive);
/* Select the drive that we are testing */ - outb(IDE_DH_DEFAULT | IDE_DH_HEAD(0) | IDE_DH_CHS | info->slave, + outb(IDE_DH_DEFAULT | IDE_DH_HEAD(0) | IDE_DH_CHS | info->slave, IDE_REG_DEVICE(ctrl)); mdelay(50);
@@ -692,17 +692,17 @@ static int init_drive(struct harddisk_info *info, struct controller *ctrl, } } debug("Probing for hd%c\n", 'a'+drive); - + memset(&cmd, 0, sizeof(cmd)); cmd.device = IDE_DH_DEFAULT | IDE_DH_HEAD(0) | IDE_DH_CHS | info->slave; cmd.command = ident_command;
- + if (pio_data_in(ctrl, &cmd, buffer, IDE_SECTOR_SIZE) < 0) { /* Well, if that command didn't work, we probably don't have drive. */ return 1; } - +
/* Now suck the data out */ drive_info = (uint16_t *)buffer; @@ -716,7 +716,7 @@ static int init_drive(struct harddisk_info *info, struct controller *ctrl, /* If the command doesn't work give up on the drive */ return 1; } - + } if ((drive_info[2] == 0x37C8) || (drive_info[2] == 0x8C73)) { /* The response is incomplete retry the drive info command */ @@ -756,7 +756,7 @@ static int init_drive(struct harddisk_info *info, struct controller *ctrl, if (drive_info[83] & (1 <<10)) { /* Should LBA48 depend on LBA? */ info->address_mode = ADDRESS_MODE_LBA48; - info->sectors = + info->sectors = (((sector_t)drive_info[103]) << 48) | (((sector_t)drive_info[102]) << 32) | (((sector_t)drive_info[101]) << 16) | @@ -768,7 +768,7 @@ static int init_drive(struct harddisk_info *info, struct controller *ctrl, info->heads = drive_info[3]; info->cylinders = drive_info[1]; info->sectors_per_track = drive_info[6]; - info->sectors = + info->sectors = info->sectors_per_track * info->heads * info->cylinders; @@ -850,7 +850,7 @@ static int ide_bus_floating(struct controller *ctrl) do { /* Take logical OR to avoid chattering */ status |= inb(IDE_REG_STATUS(ctrl)); - /* If it makes 0xff, it's possible to be floating, + /* If it makes 0xff, it's possible to be floating, * do test2 to ensure. */ if (status == 0xff) goto test2; @@ -863,7 +863,7 @@ static int ide_bus_floating(struct controller *ctrl) return 0;
test2: - /* Test 2: write something to registers, then read back and + /* Test 2: write something to registers, then read back and * compare. Note that ATA spec inhibits this while BSY is set, * but for many drives this works. This is a confirmation step anyway. */ @@ -873,7 +873,7 @@ test2: if (inb(ctrl->cmd_base+2) == 0xaa && inb(ctrl->cmd_base+3) == 0x55 && inb(ctrl->cmd_base+4) == 0xff) { - /* We have some registers there. + /* We have some registers there. * Though this does not mean it is not a NIC or something... */ return 0; } @@ -884,12 +884,12 @@ test2: return 1; }
-static int init_controller(struct controller *ctrl, int drive, unsigned char *buffer) +static int init_controller(struct controller *ctrl, int drive, unsigned char *buffer) { struct harddisk_info *info;
/* Put the drives ide channel in a know state and wait - * for the drives to spinup. + * for the drives to spinup. * * In practice IDE disks tend not to respond to commands until * they have spun up. This makes IDE hard to deal with @@ -913,7 +913,7 @@ static int init_controller(struct controller *ctrl, int drive, unsigned char *bu * So speed wise I am only slow if the BSY bit is not set * or not reported by the IDE controller during spinup, which * is quite rare. - * + * */ debug("init_controller: drive %d\n", drive); #if !BSY_SET_DURING_SPINUP @@ -930,7 +930,7 @@ static int init_controller(struct controller *ctrl, int drive, unsigned char *bu }
/* Note: I have just done a software reset. It may be - * reasonable to just read the boot time signatures + * reasonable to just read the boot time signatures * off of the drives to see if they are present. * * For now I will go with just sending commands to the drives @@ -949,7 +949,7 @@ static int init_controller(struct controller *ctrl, int drive, unsigned char *bu init_drive(info, ctrl, 0, master_drive, buffer, IDE_CMD_IDENTIFY_PACKET_DEVICE);
- debug("MASTER CHECK: master %s\n", + debug("MASTER CHECK: master %s\n", info->drive_exists ? "yes" : "no"); /* slave and master */ if (info->drive_exists && !info->slave_absent) { @@ -968,11 +968,11 @@ static int init_controller(struct controller *ctrl, int drive, unsigned char *bu if (!info->drive_exists) { debug("NO MASTER -- check slave!\n"); init_drive(info, ctrl, 1, drive, buffer, IDE_CMD_IDENTIFY_DEVICE); - + if (!info->drive_exists) init_drive(info, ctrl, 1, drive, buffer, IDE_CMD_IDENTIFY_PACKET_DEVICE); - debug("SLAVE ONLY CHECK: slave %s\n", + debug("SLAVE ONLY CHECK: slave %s\n", info->drive_exists ? "yes" : "no"); }
@@ -1221,7 +1221,7 @@ static int find_ide_controller(struct controller *ctrl, int ctrl_index) return -1; } } - + vendor = pci_read_config16(dev, 0); device = pci_read_config16(dev, 2); prog_if = pci_read_config8(dev, 9); diff --git a/drivers/ide_new.c b/drivers/ide_new.c index 3e0221a..dc1190d 100644 --- a/drivers/ide_new.c +++ b/drivers/ide_new.c @@ -1,6 +1,6 @@ /* * OpenBIOS polled ide driver - * + * * Copyright (C) 2004 Jens Axboe axboe@suse.de * Copyright (C) 2005 Stefan Reinauer stepan@openbios.org * Copyright (C) 2009-2010 coresystems GmbH @@ -357,7 +357,7 @@ ob_ide_pio_data_in(struct ide_drive *drive, struct ata_command *cmd) cmd->stat = stat; return 1; } - + ob_ide_write_registers(drive, cmd);
/* @@ -811,7 +811,7 @@ ob_ide_read_ata_lba48(struct ide_drive *drive, unsigned long long block, * read 'sectors' sectors from ata device */ static int -ob_ide_read_ata(struct ide_drive *drive, unsigned long long block, +ob_ide_read_ata(struct ide_drive *drive, unsigned long long block, unsigned char *buf, unsigned int sectors) { unsigned long long end_block = block + sectors; @@ -1134,7 +1134,7 @@ ob_ide_read_blocks(struct ide_drive *drive, int n, u32 blk, unsigned char* dest) int len = n; if (len > drive->max_sectors) len = drive->max_sectors; - + debug("reading %d sectors from blk %d\n",len, blk); if (ob_ide_read_sectors(drive, blk, dest, len)) { return n-1; @@ -1290,7 +1290,7 @@ static int find_ide_controller(struct ide_channel *chan, int chan_index) return -1; } } - + vendor = pci_read_config16(dev, 0); device = pci_read_config16(dev, 2); prog_if = pci_read_config8(dev, 9); @@ -1420,7 +1420,7 @@ int ide_probe(int drive) return -1;
return 0; - + }
int ide_probe_verbose(int drive) diff --git a/drivers/intel.c b/drivers/intel.c index 90811de..784dbd1 100644 --- a/drivers/intel.c +++ b/drivers/intel.c @@ -266,7 +266,7 @@ void platform_poweroff(void) { u16 pmbase; u32 reg32; - + pmbase = pci_read_config16(PCI_DEV(0,0x1f, 0), 0x40) & 0xfffe;
/* Mask interrupts */ @@ -324,7 +324,7 @@ void platform_reboot(void) outb(0xfe, 0x64); /* pulse reset low */ udelay(50); } - + for (;;) ; }
diff --git a/fs/Makefile.inc b/fs/Makefile.inc index 4d8650b..1bffe31 100644 --- a/fs/Makefile.inc +++ b/fs/Makefile.inc @@ -1,6 +1,6 @@ # -# Copyright (C) 2008 by coresystems GmbH -# +# Copyright (C) 2008 by coresystems GmbH +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or diff --git a/fs/filesys.h b/fs/filesys.h index 168413b..b8cffbc 100644 --- a/fs/filesys.h +++ b/fs/filesys.h @@ -44,10 +44,10 @@ static inline unsigned long __ilog2(unsigned long x) }
static inline unsigned long ffz(unsigned long x) -{ +{ if ((x = ~x) == 0) return 32; - + return __ilog2(x & -x); } #endif @@ -55,7 +55,7 @@ static inline unsigned long ffz(unsigned long x) #define log2(n) ffz(~(n))
-static inline int +static inline int substring (const char *s1, const char *s2) { while (*s1 == *s2) @@ -79,7 +79,7 @@ substring (const char *s1, const char *s2) #define MAXINT 0x7fffffff
/* This is only used by fsys_* to determine if it's hard disk. If it is, - * they try to guess filesystem type by partition type. I guess it is + * they try to guess filesystem type by partition type. I guess it is * not necessory, so hardcoded to 0 (first floppy) --ts1 */ #define current_drive 0
@@ -286,5 +286,5 @@ int aboot_dir (char *dirname); #define FS_EXT2FS 17 /* Linux Extended 2 file system */
#ifdef CONFIG_DEBUG_FSYS_EXT2FS -#define E2DEBUG +#define E2DEBUG #endif diff --git a/fs/fsys_aboot.c b/fs/fsys_aboot.c index 3bbfd9b..1e5fb91 100644 --- a/fs/fsys_aboot.c +++ b/fs/fsys_aboot.c @@ -35,7 +35,7 @@ static ARTECBOOT_HEADER bootHdr; static uint32_t fileStart = 0;
// device read helper, calls the block device read function -// returns number of bytes parsed fthe stream +// returns number of bytes parsed fthe stream
int aboot_devread(char* pData, int nSize) { @@ -45,7 +45,7 @@ int aboot_devread(char* pData, int nSize)
uint32_t sector = (fileStart + filepos) >> DEV_SECTOR_BITS; uint32_t byteOffset = (fileStart + filepos) & DEV_SECTOR_MASK; - + debug("file start %x, sector %x, offset %d\n", fileStart, sector, byteOffset);
if (sector + ((nSize + DEV_SECTOR_MASK) >> DEV_SECTOR_BITS) > part_length) @@ -63,7 +63,7 @@ int aboot_devread(char* pData, int nSize) debug("sector 0x%x read failed\n", sector); // do not abort immediately, try some more if((failCount --) == 0) return 0; - + sector ++; // try the next sector total += DEV_SECTOR_SIZE; continue; @@ -73,10 +73,10 @@ int aboot_devread(char* pData, int nSize) if (len > nSize) len = nSize; memcpy(pData, sectorBuf + byteOffset, len); - + sector ++; byteOffset = 0; - + nSize -= len; pData += len; total += len; @@ -91,10 +91,10 @@ int aboot_mount(void) debug("Mounting Artecboot VFS...\n"); // clear the boot header memset(&bootHdr, 0, sizeof(bootHdr)); - + fileStart = 0; filepos = 0; - + // now read out the boot header if(aboot_devread((char*)&bootHdr, sizeof(ARTECBOOT_HEADER)) < sizeof(ARTECBOOT_HEADER)) { @@ -130,9 +130,9 @@ int aboot_read(char *buf, int len)
read = aboot_devread(buf, len); filepos += read; // advance current position - + debug("read %d bytes, pos %x\n", read, filepos); - + // returned length may be greater than requested size because of skipped bad blocks if(read >= len) return len; return 0; @@ -143,7 +143,7 @@ int aboot_dir(char *dirname) int nRet = 0; // sanity check if(bootHdr.magicHeader != ARTECBOOT_HEADER_MAGIC) return 0; - + // we can only recognize certain hardcoded filenames if(!strcmp(dirname, ABOOT_FILE_HEADER)) { @@ -173,7 +173,7 @@ int aboot_dir(char *dirname) filemax = 0; nRet = 0; } - + debug("open file: %s, size %d, dev start %x\n", dirname, filemax, fileStart); return nRet; } diff --git a/fs/fsys_cramfs.c b/fs/fsys_cramfs.c index 7866cdb..4aa08ea 100644 --- a/fs/fsys_cramfs.c +++ b/fs/fsys_cramfs.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - + /* fsys_minix.c used as a skeleton, cramfs code in kernel used as * documentation and some code */
@@ -152,9 +152,9 @@ cramfs_strlen (const char *str)
#endif /* check filesystem types and read superblock into memory buffer */ -int +int cramfs_mount(void) -{ +{ debug_cramfs("attempting to mount a cramfs\n");
cramfs_buf = (struct cramfs_buf *) FSYS_BUF; @@ -162,17 +162,17 @@ cramfs_mount(void) debug_cramfs("partition too short\n"); return 0; } - + if (!devread(0, 0, sizeof(struct cramfs_super), (char *) &cramfs_buf->super)) { debug_cramfs("cannot read superblock\n"); return 0; } - + if (cramfs_buf->super.magic != CRAMFS_MAGIC) { debug_cramfs("magic does not match\n"); return 0; } - + if (cramfs_memcmp(CRAMFS_SIGNATURE, cramfs_buf->super.signature, 16)) { debug_cramfs("signiture does not match\n"); return 0; @@ -187,7 +187,7 @@ cramfs_mount(void) debug_cramfs("root is not a directory\n"); return 0; } - + debug_cramfs("cramfs mounted\n"); return 1; } @@ -213,14 +213,14 @@ cramfs_read (char *buf, int len) if (block) start = cramfs_buf->block_ptrs[block - 1]; else start = (cramfs_buf->inode.offset + nblocks) << 2; - + debug_cramfs("reading a file of %d blocks starting at offset %d (block %d)\n", nblocks, start, block); debug_cramfs("filepos is %d\n", filepos);
while (block < nblocks && len > 0) { end = cramfs_buf->block_ptrs[block]; block_len = end - start; - + debug_cramfs("reading to %d bytes at block %d at offset %d, %d bytes...", len, block, start, block_len); if (cramfs_buf->cached_block != block) { @@ -229,10 +229,10 @@ cramfs_read (char *buf, int len) disk_read_func = NULL; cramfs_buf->cached_block = block; } else debug_cramfs("%d was cached...", block); - + if (!ret && (filepos % CRAMFS_BLOCK)) { /* its the first read, and its not block aligned */ - debug_cramfs("doing a non-aligned decompression of block %d at offset %d\n", + debug_cramfs("doing a non-aligned decompression of block %d at offset %d\n", block, filepos % CRAMFS_BLOCK); if (cramfs_buf->decompressed_block != block) { size = decompress_block(cramfs_buf->temp, cramfs_buf->data + 2, memcpy); @@ -242,7 +242,7 @@ cramfs_read (char *buf, int len) size -= filepos % CRAMFS_BLOCK; if (size > len) size = len; if (size > 0) - memcpy(buf, cramfs_buf->temp + (filepos % CRAMFS_BLOCK), size); + memcpy(buf, cramfs_buf->temp + (filepos % CRAMFS_BLOCK), size); } else { /* just another full block read */ size = decompress_block((unsigned char *)buf, cramfs_buf->data + 2, memcpy); @@ -283,10 +283,10 @@ cramfs_dir(char *dirname)
char linkbuf[PATH_MAX]; /* buffer for following sym-links */ int link_count = 0; - + char *rest; char ch; - + u32 dir_size; /* size of this directory */ u32 off; /* offset of this directory */ u32 loc; /* location within a directory */ @@ -298,7 +298,7 @@ cramfs_dir(char *dirname)
#ifdef CONFIG_DEBUG_CRAMFS printf("\n"); -#endif +#endif
current_ino = CRAMFS_ROOT_INO; parent_ino = current_ino; @@ -379,7 +379,7 @@ cramfs_dir(char *dirname) /* skip over slashes */ while (*dirname == '/') dirname++;
- /* if this isn't a directory of sufficient size to hold our file, + /* if this isn't a directory of sufficient size to hold our file, abort */ if (!(cramfs_buf->inode.size) || !S_ISDIR(cramfs_buf->inode.mode)) { errnum = ERR_BAD_FILETYPE; @@ -412,17 +412,17 @@ cramfs_dir(char *dirname) } return (print_possibilities < 0); } - + current_ino = off + loc; - + /* read in this inode */ if (!devread(0, current_ino, sizeof(struct cramfs_inode), (char *) &cramfs_buf->inode)) return 0; - if (!devread(0, current_ino + sizeof(struct cramfs_inode), + if (!devread(0, current_ino + sizeof(struct cramfs_inode), cramfs_buf->inode.namelen << 2, cramfs_buf->name)) return 0; cramfs_buf->name[cramfs_buf->inode.namelen << 2] = '\0'; - + /* advance loc prematurely to next on-disk directory entry */ loc += sizeof(struct cramfs_inode) + (cramfs_buf->inode.namelen << 2);
diff --git a/fs/fsys_ext2fs.c b/fs/fsys_ext2fs.c index 51b3faf..64d01c0 100644 --- a/fs/fsys_ext2fs.c +++ b/fs/fsys_ext2fs.c @@ -85,7 +85,7 @@ struct ext2_super_block * the incompatible feature set is that if there is a bit set * in the incompatible feature set that the kernel doesn't * know about, it should refuse to mount the filesystem. - * + * * e2fsck's requirements are more strict; if it doesn't know * about a feature in either the compatible or incompatible * feature set, it must abort and not try to meddle with @@ -268,11 +268,11 @@ struct ext2_dir_entry char name[EXT2_NAME_LEN]; /* File name */ };
-/* linux/ext4_fs_extents.h */ +/* linux/ext4_fs_extents.h */ /* This is the extent on-disk structure. * It's used at the bottom of the tree. */ -struct ext4_extent +struct ext4_extent { __u32 ee_block; /* first logical block extent covers */ __u16 ee_len; /* number of blocks covered by extent */ @@ -284,7 +284,7 @@ struct ext4_extent * This is index on-disk structure. * It's used at all the levels except the bottom. */ -struct ext4_extent_idx +struct ext4_extent_idx { __u32 ei_block; /* index covers logical blocks from 'block' */ __u32 ei_leaf_lo; /* pointer to the physical block of the next * @@ -296,7 +296,7 @@ struct ext4_extent_idx /* * Each block (leaves and indexes), even inode-stored has header. */ -struct ext4_extent_header +struct ext4_extent_header { __u16 eh_magic; /* probably will support different formats */ __u16 eh_entries; /* number of valid entries */ @@ -369,8 +369,8 @@ struct ext4_extent_header /* kind of from ext2/super.c */ #define EXT2_BLOCK_SIZE(s) (1 << EXT2_BLOCK_SIZE_BITS(s)) /* linux/ext2fs.h */ -/* bergwolf: sizeof(struct ext2_group_desc) is changed in ext4 - * in kernel code, ext2/3 uses sizeof(struct ext2_group_desc) to calculate +/* bergwolf: sizeof(struct ext2_group_desc) is changed in ext4 + * in kernel code, ext2/3 uses sizeof(struct ext2_group_desc) to calculate * number of desc per block, while ext4 uses superblock->s_desc_size in stead * superblock->s_desc_size is not available in ext2/3 * */ @@ -437,7 +437,7 @@ dump_inode(struct ext2_inode *i) printf(" flags=%d\n", le32toh(i->i_flags)); }
-void +void dump_inode_data(unsigned char *inode, int len) { static char hexdigit[] = "0123456789abcdef"; @@ -485,8 +485,8 @@ static int ext2_rdfsb (int fsblock, void * buffer) { #ifdef E2DEBUG - printf ("ext2_rdfsb: fsblock %d, devblock %d, size %d\n", fsblock, - fsblock * (EXT2_BLOCK_SIZE (SUPERBLOCK) / DEV_BSIZE), + printf ("ext2_rdfsb: fsblock %d, devblock %d, size %d\n", fsblock, + fsblock * (EXT2_BLOCK_SIZE (SUPERBLOCK) / DEV_BSIZE), EXT2_BLOCK_SIZE (SUPERBLOCK)); #endif /* E2DEBUG */ return devread (fsblock * (EXT2_BLOCK_SIZE (SUPERBLOCK) / DEV_BSIZE), 0, @@ -593,7 +593,7 @@ ext4_ext_binsearch_idx(struct ext4_extent_header* eh, int logical_block) struct ext4_extent_idx *r, *l, *m; l = EXT_FIRST_INDEX(eh) + 1; r = EXT_LAST_INDEX(eh); - while (l <= r) + while (l <= r) { m = l + (r - l) / 2; if (logical_block < m->ei_block) @@ -604,8 +604,8 @@ ext4_ext_binsearch_idx(struct ext4_extent_header* eh, int logical_block) return (struct ext4_extent_idx*)(l - 1); }
-/* extent binary search - * find closest extent in the leaf level +/* extent binary search + * find closest extent in the leaf level * kind of from ext4_ext_binsearch in ext4/extents.c */ static struct ext4_extent* @@ -614,7 +614,7 @@ ext4_ext_binsearch(struct ext4_extent_header* eh, int logical_block) struct ext4_extent *r, *l, *m; l = EXT_FIRST_EXTENT(eh) + 1; r = EXT_LAST_EXTENT(eh); - while (l <= r) + while (l <= r) { m = l + (r - l) / 2; if (logical_block < m->ee_block) @@ -625,7 +625,7 @@ ext4_ext_binsearch(struct ext4_extent_header* eh, int logical_block) return (struct ext4_extent*)(l - 1); }
-/* Maps extents enabled logical block into physical block via an inode. +/* Maps extents enabled logical block into physical block via an inode. * EXT4_HUGE_FILE_FL should be checked before calling this. */ static int @@ -685,7 +685,7 @@ ext4fs_block_map (int logical_block)
/* depth==0, we come to the leaf */ ex = ext4_ext_binsearch(eh, logical_block); - if (ex->ee_start_hi) + if (ex->ee_start_hi) {/* 64bit physical block number not supported */ errnum = ERR_FILELENGTH; return -1; @@ -720,7 +720,7 @@ ext2fs_read (char *buf, int len) logical_block = filepos >> EXT2_BLOCK_SIZE_BITS (SUPERBLOCK); offset = filepos & (EXT2_BLOCK_SIZE (SUPERBLOCK) - 1); /* map logical block of an extents enabled file into a physical block on the disk */ - if (EXT4_HAS_INCOMPAT_FEATURE(SUPERBLOCK,EXT4_FEATURE_INCOMPAT_EXTENTS) + if (EXT4_HAS_INCOMPAT_FEATURE(SUPERBLOCK,EXT4_FEATURE_INCOMPAT_EXTENTS) && INODE->i_flags & EXT4_EXTENTS_FL) map = ext4fs_block_map (logical_block); else @@ -859,7 +859,7 @@ ext2fs_dir (char *dirname)
#ifdef E2DEBUG dump_group_desc(GROUP_DESC); -#endif /* E2DEBUG */ +#endif /* E2DEBUG */
ext4_gdp = (struct ext4_group_desc *)( (__u8*)GROUP_DESC + desc * EXT2_DESC_SIZE(SUPERBLOCK)); @@ -869,7 +869,7 @@ ext2fs_dir (char *dirname) errnum = ERR_FILELENGTH; return -1; } - ino_blk = ext4_gdp->bg_inode_table + + ino_blk = ext4_gdp->bg_inode_table + (((current_ino - 1) % le32toh(SUPERBLOCK->s_inodes_per_group)) >> log2 (EXT2_INODES_PER_BLOCK (SUPERBLOCK))); #ifdef E2DEBUG @@ -940,7 +940,7 @@ ext2fs_dir (char *dirname) } linkbuf[filemax + len] = '\0';
- /* Read the symlink data. + /* Read the symlink data. * Slow symlink is extents enabled * But since grub_read invokes ext2fs_read, nothing to change here * */ @@ -954,7 +954,7 @@ ext2fs_dir (char *dirname) } else { - /* Copy the data directly from the inode. + /* Copy the data directly from the inode. * Fast symlink is not extents enabled * */ len = filemax; @@ -1067,7 +1067,7 @@ ext2fs_dir (char *dirname) printf ("ext2fs_dir: fs block=%ld\n", map); #endif /* E2DEBUG */ mapblock2 = -1; - if (map < 0) + if (map < 0) { *rest = ch; return 0; diff --git a/fs/fsys_fat.c b/fs/fsys_fat.c index be18a11..52d82f9 100644 --- a/fs/fsys_fat.c +++ b/fs/fsys_fat.c @@ -20,7 +20,7 @@ #include "filesys.h" #include "fat.h"
-struct fat_superblock +struct fat_superblock { int fat_offset; int fat_length; @@ -28,7 +28,7 @@ struct fat_superblock int root_offset; int root_max; int data_offset; - + int num_sectors; int num_clust; int clust_eof_marker; @@ -36,7 +36,7 @@ struct fat_superblock int sectsize_bits; int clustsize_bits; int root_cluster; - + int cached_fat; int file_cluster; int current_cluster_num; @@ -56,13 +56,13 @@ fat_mount (void) { struct fat_bpb bpb; __u32 magic, first_fat; - + /* Check partition type for harddisk */ if (((current_drive & 0x80) || (current_slice != 0)) && ! IS_PC_SLICE_TYPE_FAT (current_slice) && (! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_MSDOS))) return 0; - + /* Read bpb */ if (! devread (0, 0, sizeof (bpb), (char *) &bpb)) return 0; @@ -71,34 +71,34 @@ fat_mount (void) zero division. */ if (bpb.sects_per_clust == 0) return 0; - + FAT_SUPER->sectsize_bits = log2 (FAT_CVT_U16 (bpb.bytes_per_sect)); FAT_SUPER->clustsize_bits = FAT_SUPER->sectsize_bits + log2 (bpb.sects_per_clust); - + /* Fill in info about super block */ - FAT_SUPER->num_sectors = FAT_CVT_U16 (bpb.short_sectors) + FAT_SUPER->num_sectors = FAT_CVT_U16 (bpb.short_sectors) ? FAT_CVT_U16 (bpb.short_sectors) : bpb.long_sectors; - + /* FAT offset and length */ FAT_SUPER->fat_offset = FAT_CVT_U16 (bpb.reserved_sects); - FAT_SUPER->fat_length = + FAT_SUPER->fat_length = bpb.fat_length ? bpb.fat_length : bpb.extended.fat32.fat32_length; - + /* Rootdir offset and length for FAT12/16 */ - FAT_SUPER->root_offset = + FAT_SUPER->root_offset = FAT_SUPER->fat_offset + bpb.num_fats * FAT_SUPER->fat_length; FAT_SUPER->root_max = FAT_DIRENTRY_LENGTH * FAT_CVT_U16(bpb.dir_entries); - + /* Data offset and number of clusters */ - FAT_SUPER->data_offset = + FAT_SUPER->data_offset = FAT_SUPER->root_offset + ((FAT_SUPER->root_max - 1) >> FAT_SUPER->sectsize_bits) + 1; - FAT_SUPER->num_clust = - 2 + ((FAT_SUPER->num_sectors - FAT_SUPER->data_offset) + FAT_SUPER->num_clust = + 2 + ((FAT_SUPER->num_sectors - FAT_SUPER->data_offset) / bpb.sects_per_clust); FAT_SUPER->sects_per_clust = bpb.sects_per_clust; - + if (strncmp((const char *)bpb.extended.fat16.type, "FAT12", 5) && strncmp((const char *)bpb.extended.fat16.type, "FAT16", 5) && strncmp((const char *)bpb.extended.fat32.type, "FAT32", 5)) @@ -114,7 +114,7 @@ fat_mount (void) /* FAT32 should have 0 in this field, as its root directory can grow dynamically now */ if (FAT_CVT_U16(bpb.dir_entries)) return 0; - + if (bpb.extended.fat32.flags & 0x0080) { /* FAT mirroring is disabled, get active FAT */ @@ -123,24 +123,24 @@ fat_mount (void) return 0; FAT_SUPER->fat_offset += active_fat * FAT_SUPER->fat_length; } - + FAT_SUPER->fat_size = 8; FAT_SUPER->root_cluster = bpb.extended.fat32.root_cluster;
/* Yes the following is correct. FAT32 should be called FAT28 :) */ FAT_SUPER->clust_eof_marker = 0xffffff8; - } - else + } + else { if (!FAT_SUPER->root_max) return 0; - + FAT_SUPER->root_cluster = -1; - if (FAT_SUPER->num_clust > FAT_MAX_12BIT_CLUST) + if (FAT_SUPER->num_clust > FAT_MAX_12BIT_CLUST) { FAT_SUPER->fat_size = 4; FAT_SUPER->clust_eof_marker = 0xfff8; - } + } else { FAT_SUPER->fat_size = 3; @@ -149,7 +149,7 @@ fat_mount (void) }
/* Now do some sanity checks */ - + if (FAT_CVT_U16(bpb.bytes_per_sect) != (1 << FAT_SUPER->sectsize_bits) || FAT_CVT_U16(bpb.bytes_per_sect) != SECTOR_SIZE || bpb.sects_per_clust != (1 << (FAT_SUPER->clustsize_bits @@ -158,7 +158,7 @@ fat_mount (void) || (FAT_SUPER->fat_size * FAT_SUPER->num_clust / (2 * SECTOR_SIZE) > FAT_SUPER->fat_length)) return 0; - + /* kbs: Media check on first FAT entry [ported from PUPA] */
if (!devread(FAT_SUPER->fat_offset, 0, @@ -199,7 +199,7 @@ fat_read (char *buf, int len) int offset; int ret = 0; int size; - + if (FAT_SUPER->file_cluster < 0) { /* root directory for fat16 */ @@ -211,7 +211,7 @@ fat_read (char *buf, int len) filepos += size; return size; } - + logical_clust = filepos >> FAT_SUPER->clustsize_bits; offset = (filepos & ((1 << FAT_SUPER->clustsize_bits) - 1)); if (logical_clust < FAT_SUPER->current_cluster_num) @@ -219,19 +219,19 @@ fat_read (char *buf, int len) FAT_SUPER->current_cluster_num = 0; FAT_SUPER->current_cluster = FAT_SUPER->file_cluster; } - + while (len > 0) { int sector; while (logical_clust > FAT_SUPER->current_cluster_num) { /* calculate next cluster */ - int fat_entry = + int fat_entry = FAT_SUPER->current_cluster * FAT_SUPER->fat_size; int next_cluster; int cached_pos = (fat_entry - FAT_SUPER->cached_fat); - - if (cached_pos < 0 || + + if (cached_pos < 0 || (cached_pos + FAT_SUPER->fat_size) > 2*FAT_CACHE_SIZE) { FAT_SUPER->cached_fat = (fat_entry & ~(2*SECTOR_SIZE - 1)); @@ -250,7 +250,7 @@ fat_read (char *buf, int len) } else if (FAT_SUPER->fat_size == 4) next_cluster &= 0xFFFF; - + if (next_cluster >= FAT_SUPER->clust_eof_marker) return ret; if (next_cluster < 2 || next_cluster >= FAT_SUPER->num_clust) @@ -258,24 +258,24 @@ fat_read (char *buf, int len) errnum = ERR_FSYS_CORRUPT; return 0; } - + FAT_SUPER->current_cluster = next_cluster; FAT_SUPER->current_cluster_num++; } - + sector = FAT_SUPER->data_offset + ((FAT_SUPER->current_cluster - 2) << (FAT_SUPER->clustsize_bits - FAT_SUPER->sectsize_bits)); size = (1 << FAT_SUPER->clustsize_bits) - offset; if (size > len) size = len; - + disk_read_func = disk_read_hook; - + devread(sector, offset, size, buf); - + disk_read_func = NULL; - + len -= size; buf += size; ret += size; @@ -295,25 +295,25 @@ fat_dir (char *dirname) #ifndef STAGE1_5 int do_possibilities = 0; #endif - + /* XXX I18N: - * the positions 2,4,6 etc are high bytes of a 16 bit unicode char + * the positions 2,4,6 etc are high bytes of a 16 bit unicode char */ - static unsigned char longdir_pos[] = + static unsigned char longdir_pos[] = { 1, 3, 5, 7, 9, 14, 16, 18, 20, 22, 24, 28, 30 }; int slot = -2; int alias_checksum = -1; - + FAT_SUPER->file_cluster = FAT_SUPER->root_cluster; filepos = 0; FAT_SUPER->current_cluster_num = MAXINT; - + /* main loop to find desired directory entry */ loop: - + /* if we have a real file (and we're not just printing possibilities), then this is where we want to exit */ - + if (!*dirname || isspace (*dirname)) { if (attrib & FAT_ATTRIB_DIR) @@ -321,15 +321,15 @@ fat_dir (char *dirname) errnum = ERR_BAD_FILETYPE; return 0; } - + return 1; } - + /* continue with the file/directory name interpretation */ - + while (*dirname == '/') dirname++; - + if (!(attrib & FAT_ATTRIB_DIR)) { errnum = ERR_BAD_FILETYPE; @@ -337,16 +337,16 @@ fat_dir (char *dirname) } /* Directories don't have a file size */ filemax = MAXINT; - + for (rest = dirname; (ch = *rest) && !isspace (ch) && ch != '/'; rest++); - + *rest = 0; - + # ifndef STAGE1_5 if (print_possibilities && ch != '/') do_possibilities = 1; # endif - + while (1) { if (fat_read (dir_buf, FAT_DIRENTRY_LENGTH) != FAT_DIRENTRY_LENGTH @@ -363,14 +363,14 @@ fat_dir (char *dirname) return 1; } # endif /* STAGE1_5 */ - + errnum = ERR_FILE_NOT_FOUND; *rest = ch; } - + return 0; } - + if (FAT_DIRENTRY_ATTRIB (dir_buf) == FAT_ATTRIB_LONGNAME) { /* This is a long filename. The filename is build from back @@ -387,72 +387,72 @@ fat_dir (char *dirname) */ int i, offset; unsigned char id = FAT_LONGDIR_ID(dir_buf); - - if ((id & 0x40)) + + if ((id & 0x40)) { id &= 0x3f; slot = id; filename[slot * 13] = 0; alias_checksum = FAT_LONGDIR_ALIASCHECKSUM(dir_buf); - } - + } + if (id != slot || slot == 0 || alias_checksum != FAT_LONGDIR_ALIASCHECKSUM(dir_buf)) { alias_checksum = -1; continue; } - + slot--; offset = slot * 13; - + for (i=0; i < 13; i++) filename[offset+i] = dir_buf[longdir_pos[i]]; continue; } - + if (!FAT_DIRENTRY_VALID (dir_buf)) continue; - + if (alias_checksum != -1 && slot == 0) { int i; unsigned char sum; - + slot = -2; for (sum = 0, i = 0; i< 11; i++) sum = ((sum >> 1) | (sum << 7)) + dir_buf[i]; - + if (sum == alias_checksum) { # ifndef STAGE1_5 if (do_possibilities) goto print_filename; # endif /* STAGE1_5 */ - + if (substring (dirname, filename) == 0) break; } } - + /* XXX convert to 8.3 filename format here */ { int i, j, c; - + for (i = 0; i < 8 && (c = filename[i] = tolower (dir_buf[i])) && !isspace (c); i++); - + filename[i++] = '.'; - + for (j = 0; j < 3 && (c = filename[i + j] = tolower (dir_buf[8 + j])) && !isspace (c); j++); - + if (j == 0) i--; - + filename[i + j] = 0; } - + # ifndef STAGE1_5 if (do_possibilities) { @@ -466,19 +466,19 @@ fat_dir (char *dirname) continue; } # endif /* STAGE1_5 */ - + if (substring (dirname, filename) == 0) break; } - + *(dirname = rest) = ch; - + attrib = FAT_DIRENTRY_ATTRIB (dir_buf); filemax = FAT_DIRENTRY_FILELENGTH (dir_buf); filepos = 0; FAT_SUPER->file_cluster = FAT_DIRENTRY_FIRST_CLUSTER (dir_buf); FAT_SUPER->current_cluster_num = MAXINT; - + /* go back to main loop at top of function */ goto loop; } diff --git a/fs/fsys_iso9660.c b/fs/fsys_iso9660.c index a29128e..0a5e544 100644 --- a/fs/fsys_iso9660.c +++ b/fs/fsys_iso9660.c @@ -79,7 +79,7 @@ iso9660_mount (void) */ for (sector = 16 ; sector < 32 ; sector++) { - if (!iso9660_devread(sector, 0, sizeof(*PRIMDESC), (char *)PRIMDESC)) + if (!iso9660_devread(sector, 0, sizeof(*PRIMDESC), (char *)PRIMDESC)) break; /* check ISO_VD_PRIMARY and ISO_STANDARD_ID */ if (CHECK4(&PRIMDESC->type, ISO_VD_PRIMARY, 'C', 'D', '0') diff --git a/fs/fsys_jfs.c b/fs/fsys_jfs.c index 2e46d93..c51a1a1 100644 --- a/fs/fsys_jfs.c +++ b/fs/fsys_jfs.c @@ -1,5 +1,5 @@ /* fsys_jfs.c - an implementation for the IBM JFS file system */ -/* +/* * GRUB -- GRand Unified Bootloader * Copyright (C) 2001,2002 Free Software Foundation, Inc. * @@ -237,7 +237,7 @@ jfs_read (char *buf, int len) offset = offsetXAD (xad); xadlen = lengthXAD (xad); if (isinxt (filepos >> jfs.l2bsize, offset, xadlen)) { - endofcur = (offset + xadlen) << jfs.l2bsize; + endofcur = (offset + xadlen) << jfs.l2bsize; toread = (endofcur >= endpos) ? len : (endofcur - filepos);
@@ -259,7 +259,7 @@ jfs_read (char *buf, int len) } continue; } - endofprev = offset + xadlen; + endofprev = offset + xadlen; xad = next_extent (); } while (len > 0 && xad);
diff --git a/fs/fsys_minix.c b/fs/fsys_minix.c index f9b7519..a07621e 100644 --- a/fs/fsys_minix.c +++ b/fs/fsys_minix.c @@ -20,7 +20,7 @@ /* Restrictions: This is MINIX V1 only (yet) Disk creation is like: - mkfs.minix -c DEVICE + mkfs.minix -c DEVICE */
#include "filesys.h" @@ -72,7 +72,7 @@ typedef unsigned int __u32; #define MINIX_V1 0x0001 /* original minix fs */ #define MINIX_V2 0x0002 /* minix V2 fs */
-/* originally this is : +/* originally this is : #define INODE_VERSION(inode) inode->i_sb->u.minix_sb.s_version here we have */ #define INODE_VERSION(inode) (SUPERBLOCK->s_version) @@ -161,15 +161,15 @@ minix_mount (void) && ! IS_PC_SLICE_TYPE_MINIX (current_slice) && ! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_OTHER)) return 0; /* The partition is not of MINIX type */ - + if (part_length < (SBLOCK + (sizeof (struct minix_super_block) / DEV_BSIZE))) return 0; /* The partition is too short */ - + if (!devread (SBLOCK, 0, sizeof (struct minix_super_block), (char *) SUPERBLOCK)) return 0; /* Cannot read superblock */ - + switch (SUPERBLOCK->s_magic) { case MINIX_SUPER_MAGIC: @@ -207,7 +207,7 @@ minix_block_map (int logical_block) if (logical_block < 512) { i = INODE->i_zone[7]; - + if (!i || ((mapblock1 != 1) && !minix_rdfsb (i, DATABLOCK1))) { @@ -308,7 +308,7 @@ minix_dir (char *dirname) char * rest; char ch;
- int off; /* offset within block of directory + int off; /* offset within block of directory entry */ int loc; /* location within a directory */ int blk; /* which data blk within dir entry */ @@ -323,7 +323,7 @@ minix_dir (char *dirname)
#ifdef DEBUG_MINIX printf ("\n"); -#endif +#endif
while (1) { @@ -342,7 +342,7 @@ minix_dir (char *dirname) raw_inode = INODE + ((current_ino - 1) % MINIX_INODES_PER_BLOCK);
/* copy inode to fixed location */ - memmove ((void *) INODE, (void *) raw_inode, + memmove ((void *) INODE, (void *) raw_inode, sizeof (struct minix_inode));
/* If we've got a symbolic link, then chase it. */ @@ -427,7 +427,7 @@ minix_dir (char *dirname) while (*dirname == '/') dirname++;
- /* if this isn't a directory of sufficient size to hold our file, + /* if this isn't a directory of sufficient size to hold our file, abort */ if (!(INODE->i_size) || !S_ISDIR (INODE->i_mode)) { diff --git a/fs/fsys_reiserfs.c b/fs/fsys_reiserfs.c index d3de6be..770be51 100644 --- a/fs/fsys_reiserfs.c +++ b/fs/fsys_reiserfs.c @@ -93,9 +93,9 @@ struct reiserfs_journal_commit {
/* this header block gets written whenever a transaction is considered fully flushed, and is more recent than the last fully flushed - transaction. + transaction. fully flushed means all the log blocks and all the real blocks are - on disk, and this transaction does not need to be replayed. + on disk, and this transaction does not need to be replayed. */ struct reiserfs_journal_header { /* id of last fully flushed transaction */ @@ -107,7 +107,7 @@ struct reiserfs_journal_header { };
/* magic string to find desc blocks in the journal */ -#define JOURNAL_DESC_MAGIC "ReIsErLB" +#define JOURNAL_DESC_MAGIC "ReIsErLB"
/* @@ -124,7 +124,7 @@ struct offset_v1 * hashing the name and using few bits (23 or more) of the resulting * hash, and generation number that allows distinguishing names with * hash collisions. If number of collisions overflows generation - * number, we return EEXIST. High order bit is 0 always + * number, we return EEXIST. High order bit is 0 always */ __u32 k_offset; __u32 k_uniqueness; @@ -141,7 +141,7 @@ struct offset_v2 * hashing the name and using few bits (23 or more) of the resulting * hash, and generation number that allows distinguishing names with * hash collisions. If number of collisions overflows generation - * number, we return EEXIST. High order bit is 0 always + * number, we return EEXIST. High order bit is 0 always */ __u64 k_offset:60; __u64 k_type: 4; @@ -168,7 +168,7 @@ struct key /* Header of a disk block. More precisely, header of a formatted leaf or internal node, and not the header of an unformatted node. */ struct block_head -{ +{ __u16 blk_level; /* Level of a block in the tree. */ __u16 blk_nr_item; /* Number of keys/items in a block. */ __u16 blk_free_space; /* Block free space in bytes. */ @@ -181,7 +181,7 @@ struct block_head struct item_head { struct key ih_key; /* Everything in the tree is found by searching for it based on its key.*/ - + union { __u16 ih_free_space; /* The free space in the last unformatted node of an indirect item if this @@ -194,8 +194,8 @@ struct item_head u; __u16 ih_item_len; /* total size of the item body */ __u16 ih_item_location; /* an offset to the item body within the block */ - __u16 ih_version; /* ITEM_VERSION_1 for all old items, - ITEM_VERSION_2 for new ones. + __u16 ih_version; /* ITEM_VERSION_1 for all old items, + ITEM_VERSION_2 for new ones. Highest bit is set by fsck temporary, cleaned after all done */ }; @@ -264,7 +264,7 @@ struct reiserfs_de_head #define V2_TYPE_STAT_DATA 0 #define V2_TYPE_INDIRECT 1 #define V2_TYPE_DIRECT 2 -#define V2_TYPE_DIRENTRY 3 +#define V2_TYPE_DIRENTRY 3
#define REISERFS_ROOT_OBJECTID 2 #define REISERFS_ROOT_PARENT_OBJECTID 1 @@ -323,7 +323,7 @@ struct fsys_reiser_info __u16 cached_slots; /* The number of valid transactions in journal */ __u16 journal_transactions; - + unsigned int blocks[MAX_HEIGHT]; unsigned int next_key_nr[MAX_HEIGHT]; }; @@ -344,13 +344,13 @@ struct fsys_reiser_info */ #define INFO \ ((struct fsys_reiser_info *) ((int) FSYS_BUF + FSYSREISER_CACHE_SIZE)) -/* +/* * The journal cache. For each transaction it contains the number of - * blocks followed by the real block numbers of this transaction. + * blocks followed by the real block numbers of this transaction. * * If the block numbers of some transaction won't fit in this space, * this list is stopped with a 0xffffffff marker and the remaining - * uncommitted transactions aren't cached. + * uncommitted transactions aren't cached. */ #define JOURNAL_START ((__u32 *) (INFO + 1)) #define JOURNAL_END ((__u32 *) (FSYS_BUF + FSYS_BUFLEN)) @@ -361,16 +361,16 @@ is_power_of_two (unsigned long word) return (word & -word) == word; }
-static int -journal_read (int block, int len, char *buffer) +static int +journal_read (int block, int len, char *buffer) { - return devread ((INFO->journal_block + block) << INFO->blocksize_shift, + return devread ((INFO->journal_block + block) << INFO->blocksize_shift, 0, len, buffer); }
/* Read a block from ReiserFS file system, taking the journal into * account. If the block nr is in the journal, the block from the - * journal taken. + * journal taken. */ static int block_read (int blockNr, int start, int len, char *buffer) @@ -380,7 +380,7 @@ block_read (int blockNr, int start, int len, char *buffer) int journal_mask = INFO->journal_block_count - 1; int translatedNr = blockNr; __u32 *journal_table = JOURNAL_START; - while (transactions-- > 0) + while (transactions-- > 0) { int i = 0; int j_len; @@ -412,11 +412,11 @@ block_read (int blockNr, int start, int len, char *buffer) while (i < j_len && i < JOURNAL_TRANS_HALF) if (desc.j_realblock[i++] == blockNr) goto found; - + if (j_len >= JOURNAL_TRANS_HALF) { int commit_block = (desc_block + 1 + j_len) & journal_mask; - if (! journal_read (commit_block, + if (! journal_read (commit_block, sizeof (commit), (char *) &commit)) return 0; while (i < j_len) @@ -425,11 +425,11 @@ block_read (int blockNr, int start, int len, char *buffer) } } goto not_found; - + found: translatedNr = INFO->journal_block + ((desc_block + i) & journal_mask); #ifdef REISERDEBUG - printf ("block_read: block %d is mapped to journal block %d.\n", + printf ("block_read: block %d is mapped to journal block %d.\n", blockNr, translatedNr - INFO->journal_block); #endif /* We must continue the search, as this block may be overwritten @@ -446,8 +446,8 @@ block_read (int blockNr, int start, int len, char *buffer) * we can still read the rest from the disk on demand. * * The first number of valid transactions and the descriptor block of the - * first valid transaction are held in INFO. The transactions are all - * adjacent, but we must take care of the journal wrap around. + * first valid transaction are held in INFO. The transactions are all + * adjacent, but we must take care of the journal wrap around. */ static int journal_init (void) @@ -470,11 +470,11 @@ journal_init (void) next_trans_id = header.j_last_flush_trans_id + 1;
#ifdef REISERDEBUG - printf ("journal_init: last flushed %d\n", + printf ("journal_init: last flushed %d\n", header.j_last_flush_trans_id); #endif
- while (1) + while (1) { journal_read (desc_block, sizeof (desc), (char *) &desc); if (substring (JOURNAL_DESC_MAGIC, desc.j_magic) > 0 @@ -482,16 +482,16 @@ journal_init (void) || desc.j_mount_id != header.j_mount_id) /* no more valid transactions */ break; - + commit_block = (desc_block + desc.j_len + 1) & (block_count - 1); journal_read (commit_block, sizeof (commit), (char *) &commit); if (desc.j_trans_id != commit.j_trans_id || desc.j_len != commit.j_len) /* no more valid transactions */ break; - + #ifdef REISERDEBUG - printf ("Found valid transaction %d/%d at %d.\n", + printf ("Found valid transaction %d/%d at %d.\n", desc.j_trans_id, desc.j_mount_id, desc_block); #endif
@@ -517,7 +517,7 @@ journal_init (void) { *journal_table++ = desc.j_realblock[i]; #ifdef REISERDEBUG - printf ("block %d is in journal %d.\n", + printf ("block %d is in journal %d.\n", desc.j_realblock[i], desc_block); #endif } @@ -525,8 +525,8 @@ journal_init (void) { *journal_table++ = commit.j_realblock[i-JOURNAL_TRANS_HALF]; #ifdef REISERDEBUG - printf ("block %d is in journal %d.\n", - commit.j_realblock[i-JOURNAL_TRANS_HALF], + printf ("block %d is in journal %d.\n", + commit.j_realblock[i-JOURNAL_TRANS_HALF], desc_block); #endif } @@ -535,7 +535,7 @@ journal_init (void) desc_block = (commit_block + 1) & (block_count - 1); } #ifdef REISERDEBUG - printf ("Transaction %d/%d at %d isn't valid.\n", + printf ("Transaction %d/%d at %d isn't valid.\n", desc.j_trans_id, desc.j_mount_id, desc_block); #endif
@@ -552,7 +552,7 @@ reiserfs_mount (void) int superblock = REISERFS_DISK_OFFSET_IN_BYTES >> SECTOR_BITS;
if (part_length < superblock + (sizeof (super) >> SECTOR_BITS) - || ! devread (superblock, 0, sizeof (struct reiserfs_super_block), + || ! devread (superblock, 0, sizeof (struct reiserfs_super_block), (char *) &super) || (substring (REISER3FS_SUPER_MAGIC_STRING, super.s_magic) > 0 && substring (REISER2FS_SUPER_MAGIC_STRING, super.s_magic) > 0 @@ -564,7 +564,7 @@ reiserfs_mount (void) /* Try old super block position */ superblock = REISERFS_OLD_DISK_OFFSET_IN_BYTES >> SECTOR_BITS; if (part_length < superblock + (sizeof (super) >> SECTOR_BITS) - || ! devread (superblock, 0, sizeof (struct reiserfs_super_block), + || ! devread (superblock, 0, sizeof (struct reiserfs_super_block), (char *) &super)) return 0;
@@ -573,10 +573,10 @@ reiserfs_mount (void) && substring (REISERFS_SUPER_MAGIC_STRING, super.s_magic) > 0) { /* pre journaling super block ? */ - if (substring (REISERFS_SUPER_MAGIC_STRING, + if (substring (REISERFS_SUPER_MAGIC_STRING, (char*) ((int) &super + 20)) > 0) return 0; - + super.s_blocksize = REISERFS_OLD_BLOCKSIZE; super.s_journal_block = 0; super.s_version = 0; @@ -586,16 +586,16 @@ reiserfs_mount (void) /* check the version number. */ if (super.s_version > REISERFS_MAX_SUPPORTED_VERSION) return 0; - + INFO->version = super.s_version; INFO->blocksize = super.s_blocksize; INFO->fullblocksize_shift = log2 (super.s_blocksize); INFO->blocksize_shift = INFO->fullblocksize_shift - SECTOR_BITS; - INFO->cached_slots = + INFO->cached_slots = (FSYSREISER_CACHE_SIZE >> INFO->fullblocksize_shift) - 1;
#ifdef REISERDEBUG - printf ("reiserfs_mount: version=%d, blocksize=%d\n", + printf ("reiserfs_mount: version=%d, blocksize=%d\n", INFO->version, INFO->blocksize); #endif /* REISERDEBUG */
@@ -608,7 +608,7 @@ reiserfs_mount (void) return 0;
/* Initialize journal code. If something fails we end with zero - * journal_transactions, so we don't access the journal at all. + * journal_transactions, so we don't access the journal at all. */ INFO->journal_transactions = 0; if (super.s_journal_block != 0 && super.s_journal_dev == 0) @@ -619,17 +619,17 @@ reiserfs_mount (void) journal_init ();
/* Read in super block again, maybe it is in the journal */ - block_read (superblock >> INFO->blocksize_shift, + block_read (superblock >> INFO->blocksize_shift, 0, sizeof (struct reiserfs_super_block), (char *) &super); }
if (! block_read (super.s_root_block, 0, INFO->blocksize, (char*) ROOT)) return 0; - + INFO->tree_depth = BLOCKHEAD (ROOT)->blk_level; - + #ifdef REISERDEBUG - printf ("root read_in: block=%d, depth=%d\n", + printf ("root read_in: block=%d, depth=%d\n", super.s_root_block, INFO->tree_depth); #endif /* REISERDEBUG */
@@ -637,7 +637,7 @@ reiserfs_mount (void) return 0; if (INFO->tree_depth == DISK_LEAF_NODE_LEVEL) { - /* There is only one node in the whole filesystem, + /* There is only one node in the whole filesystem, * which is simultanously leaf and root */ memcpy (LEAF, ROOT, INFO->blocksize); } @@ -652,7 +652,7 @@ reiserfs_mount (void) * My tree node cache is organized as following * 0 ROOT node * 1 LEAF node (if the ROOT is also a LEAF it is copied here - * 2-n other nodes on current path from bottom to top. + * 2-n other nodes on current path from bottom to top. * if there is not enough space in the cache, the top most are * omitted. * @@ -662,7 +662,7 @@ reiserfs_mount (void) * next_key() gets the next key in tree order. * * This means, that I can only sequential reads of files are - * efficient, but this really doesn't hurt for grub. + * efficient, but this really doesn't hurt for grub. */
/* Read in the node at the current path and depth into the node cache. @@ -676,7 +676,7 @@ read_tree_node (unsigned int blockNr, int depth) if (depth < num_cached) { /* This is the cached part of the path. Check if same block is - * needed. + * needed. */ if (blockNr == INFO->blocks[depth]) return cache; @@ -702,7 +702,7 @@ read_tree_node (unsigned int blockNr, int depth) }
/* Get the next key, i.e. the key following the last retrieved key in - * tree order. INFO->current_ih and + * tree order. INFO->current_ih and * INFO->current_info are adapted accordingly. */ static int next_key (void) @@ -710,21 +710,21 @@ next_key (void) int depth; struct item_head *ih = INFO->current_ih + 1; char *cache; - + #ifdef REISERDEBUG - printf ("next_key:\n old ih: key %d:%d:%d:%d version:%d\n", - INFO->current_ih->ih_key.k_dir_id, - INFO->current_ih->ih_key.k_objectid, + printf ("next_key:\n old ih: key %d:%d:%d:%d version:%d\n", + INFO->current_ih->ih_key.k_dir_id, + INFO->current_ih->ih_key.k_objectid, INFO->current_ih->ih_key.u.v1.k_offset, INFO->current_ih->ih_key.u.v1.k_uniqueness, INFO->current_ih->ih_version); #endif /* REISERDEBUG */ - + if (ih == &ITEMHEAD[BLOCKHEAD (LEAF)->blk_nr_item]) { depth = DISK_LEAF_NODE_LEVEL; - /* The last item, was the last in the leaf node. - * Read in the next block + /* The last item, was the last in the leaf node. + * Read in the next block */ do { @@ -741,18 +741,18 @@ next_key (void) #endif /* REISERDEBUG */ } while (INFO->next_key_nr[depth] == 0); - + if (depth == INFO->tree_depth) cache = ROOT; else if (depth <= INFO->cached_slots) cache = CACHE (depth); - else + else { cache = read_tree_node (INFO->blocks[depth], depth); if (! cache) return 0; } - + do { int nr_item = BLOCKHEAD (cache)->blk_nr_item; @@ -769,16 +769,16 @@ next_key (void) return 0; } while (depth > DISK_LEAF_NODE_LEVEL); - + ih = ITEMHEAD; } found: INFO->current_ih = ih; INFO->current_item = &LEAF[ih->ih_item_location]; #ifdef REISERDEBUG - printf (" new ih: key %d:%d:%d:%d version:%d\n", - INFO->current_ih->ih_key.k_dir_id, - INFO->current_ih->ih_key.k_objectid, + printf (" new ih: key %d:%d:%d:%d version:%d\n", + INFO->current_ih->ih_key.k_dir_id, + INFO->current_ih->ih_key.k_objectid, INFO->current_ih->ih_key.u.v1.k_offset, INFO->current_ih->ih_key.u.v1.k_uniqueness, INFO->current_ih->ih_version); @@ -786,18 +786,18 @@ next_key (void) return 1; }
-/* preconditions: reiserfs_mount already executed, therefore +/* preconditions: reiserfs_mount already executed, therefore * INFO block is valid - * returns: 0 if error (errnum is set), + * returns: 0 if error (errnum is set), * nonzero iff we were able to find the key successfully. - * postconditions: on a nonzero return, the current_ih and + * postconditions: on a nonzero return, the current_ih and * current_item fields describe the key that equals the * searched key. INFO->next_key contains the next key after * the searched key. * side effects: messes around with the cache. */ static int -search_stat (__u32 dir_id, __u32 objectid) +search_stat (__u32 dir_id, __u32 objectid) { char *cache; int depth; @@ -807,21 +807,21 @@ search_stat (__u32 dir_id, __u32 objectid) #ifdef REISERDEBUG printf ("search_stat:\n key %d:%d:0:0\n", dir_id, objectid); #endif /* REISERDEBUG */ - + depth = INFO->tree_depth; cache = ROOT; - + while (depth > DISK_LEAF_NODE_LEVEL) { struct key *key; nr_item = BLOCKHEAD (cache)->blk_nr_item; - + key = KEY (cache); - - for (i = 0; i < nr_item; i++) + + for (i = 0; i < nr_item; i++) { if (key->k_dir_id > dir_id - || (key->k_dir_id == dir_id + || (key->k_dir_id == dir_id && (key->k_objectid > objectid || (key->k_objectid == objectid && (key->u.v1.k_offset @@ -829,7 +829,7 @@ search_stat (__u32 dir_id, __u32 objectid) break; key++; } - + #ifdef REISERDEBUG printf (" depth=%d, i=%d/%d\n", depth, i, nr_item); #endif /* REISERDEBUG */ @@ -838,13 +838,13 @@ search_stat (__u32 dir_id, __u32 objectid) if (! cache) return 0; } - + /* cache == LEAF */ nr_item = BLOCKHEAD (LEAF)->blk_nr_item; ih = ITEMHEAD; - for (i = 0; i < nr_item; i++) + for (i = 0; i < nr_item; i++) { - if (ih->ih_key.k_dir_id == dir_id + if (ih->ih_key.k_dir_id == dir_id && ih->ih_key.k_objectid == objectid && ih->ih_key.u.v1.k_offset == 0 && ih->ih_key.u.v1.k_uniqueness == 0) @@ -869,32 +869,32 @@ reiserfs_read (char *buf, int len) unsigned int offset; unsigned int to_read; char *prev_buf = buf; - + #ifdef REISERDEBUG printf ("reiserfs_read: filepos=%d len=%d, offset=%x:%x\n", filepos, len, (__u64) IH_KEY_OFFSET (INFO->current_ih) - 1); #endif /* REISERDEBUG */ - + if (INFO->current_ih->ih_key.k_objectid != INFO->fileinfo.k_objectid || IH_KEY_OFFSET (INFO->current_ih) > filepos + 1) { search_stat (INFO->fileinfo.k_dir_id, INFO->fileinfo.k_objectid); goto get_next_key; } - + while (! errnum) { if (INFO->current_ih->ih_key.k_objectid != INFO->fileinfo.k_objectid) break; - + offset = filepos - IH_KEY_OFFSET (INFO->current_ih) + 1; blocksize = INFO->current_ih->ih_item_len; - + #ifdef REISERDEBUG printf (" loop: filepos=%d len=%d, offset=%d blocksize=%d\n", filepos, len, offset, blocksize); #endif /* REISERDEBUG */ - + if (IH_KEY_ISTYPE(INFO->current_ih, TYPE_DIRECT) && offset < blocksize) { @@ -905,14 +905,14 @@ reiserfs_read (char *buf, int len) to_read = blocksize - offset; if (to_read > len) to_read = len; - + if (disk_read_hook != NULL) { disk_read_func = disk_read_hook; - + block_read (INFO->blocks[DISK_LEAF_NODE_LEVEL], (INFO->current_item - LEAF + offset), to_read, buf); - + disk_read_func = NULL; } else @@ -926,25 +926,25 @@ reiserfs_read (char *buf, int len) printf ("indirect_read: offset=%d, blocksize=%d\n", offset, blocksize); #endif /* REISERDEBUG */ - + while (offset < blocksize) { __u32 blocknr = ((__u32 *) INFO->current_item) [offset >> INFO->fullblocksize_shift]; int blk_offset = offset & (INFO->blocksize-1); - + to_read = INFO->blocksize - blk_offset; if (to_read > len) to_read = len; - + disk_read_func = disk_read_hook; - + /* Journal is only for meta data. Data blocks can be read * directly without using block_read */ devread (blocknr << INFO->blocksize_shift, blk_offset, to_read, buf); - + disk_read_func = NULL; update_buf_len: len -= to_read; @@ -963,11 +963,11 @@ reiserfs_read (char *buf, int len) }
-/* preconditions: reiserfs_mount already executed, therefore +/* preconditions: reiserfs_mount already executed, therefore * INFO block is valid * returns: 0 if error, nonzero iff we were able to find the file successfully * postconditions: on a nonzero return, INFO->fileinfo contains the info - * of the file we were trying to look up, filepos is 0 and filemax is + * of the file we were trying to look up, filepos is 0 and filemax is * the size of the file. */ int @@ -985,23 +985,23 @@ reiserfs_dir (char *dirname)
dir_id = REISERFS_ROOT_PARENT_OBJECTID; objectid = REISERFS_ROOT_OBJECTID; - + while (1) { #ifdef REISERDEBUG printf ("dirname=%s\n", dirname); #endif /* REISERDEBUG */ - + /* Search for the stat info first. */ if (! search_stat (dir_id, objectid)) return 0; - + #ifdef REISERDEBUG - printf ("sd_mode=%x sd_size=%d\n", + printf ("sd_mode=%x sd_size=%d\n", ((struct stat_data *) INFO->current_item)->sd_mode, ((struct stat_data *) INFO->current_item)->sd_size); #endif /* REISERDEBUG */ - + mode = ((struct stat_data *) INFO->current_item)->sd_mode;
/* If we've got a symbolic link, then chase it. */ @@ -1027,7 +1027,7 @@ reiserfs_dir (char *dirname) errnum = ERR_FILELENGTH; return 0; } - + /* Copy the remaining name to the end of the symlink data. Note that DIRNAME and LINKBUF may overlap! */ grub_memmove (linkbuf + filemax, dirname, len+1); @@ -1067,7 +1067,7 @@ reiserfs_dir (char *dirname)
/* if we have a real file (and we're not just printing possibilities), then this is where we want to exit */ - + if (! *dirname || isspace (*dirname)) { if (! S_ISREG (mode)) @@ -1075,22 +1075,22 @@ reiserfs_dir (char *dirname) errnum = ERR_BAD_FILETYPE; return 0; } - + filepos = 0; filemax = ((struct stat_data *) INFO->current_item)->sd_size; - - /* If this is a new stat data and size is > 4GB set filemax to + + /* If this is a new stat data and size is > 4GB set filemax to * maximum */ if (INFO->current_ih->ih_version == ITEM_VERSION_2 && ((struct stat_data *) INFO->current_item)->sd_size_hi > 0) filemax = 0xffffffff; - + INFO->fileinfo.k_dir_id = dir_id; INFO->fileinfo.k_objectid = objectid; return next_key (); } - + /* continue with the file/directory name interpretation */ while (*dirname == '/') dirname++; @@ -1101,31 +1101,31 @@ reiserfs_dir (char *dirname) } for (rest = dirname; (ch = *rest) && ! isspace (ch) && ch != '/'; rest++); *rest = 0; - + # ifndef STAGE1_5 if (print_possibilities && ch != '/') do_possibilities = 1; # endif /* ! STAGE1_5 */ - + while (1) { char *name_end; int num_entries; - + if (! next_key ()) return 0; #ifdef REISERDEBUG - printf ("ih: key %d:%d:%d:%d version:%d\n", - INFO->current_ih->ih_key.k_dir_id, - INFO->current_ih->ih_key.k_objectid, + printf ("ih: key %d:%d:%d:%d version:%d\n", + INFO->current_ih->ih_key.k_dir_id, + INFO->current_ih->ih_key.k_objectid, INFO->current_ih->ih_key.u.v1.k_offset, INFO->current_ih->ih_key.u.v1.k_uniqueness, INFO->current_ih->ih_version); #endif /* REISERDEBUG */ - + if (INFO->current_ih->ih_key.k_objectid != objectid) break; - + name_end = INFO->current_item + INFO->current_ih->ih_item_len; de_head = (struct reiserfs_de_head *) INFO->current_item; num_entries = INFO->current_ih->u.ih_entry_count; @@ -1140,7 +1140,7 @@ reiserfs_dir (char *dirname) * terminated. We write a temporary 0 behind it. * NOTE: that this may overwrite the first block in * the tree cache. That doesn't hurt as long as we - * don't call next_key () in between. + * don't call next_key () in between. */ *name_end = 0; cmp = substring (dirname, filename); @@ -1169,18 +1169,18 @@ reiserfs_dir (char *dirname) num_entries--; } } - + # ifndef STAGE1_5 if (print_possibilities < 0) return 1; # endif /* ! STAGE1_5 */ - + errnum = ERR_FILE_NOT_FOUND; *rest = ch; return 0; - + found: - + *rest = ch; dirname = rest;
@@ -1196,23 +1196,23 @@ reiserfs_embed (int *start_sector, int needed_sectors) { struct reiserfs_super_block super; int num_sectors; - - if (! devread (REISERFS_DISK_OFFSET_IN_BYTES >> SECTOR_BITS, 0, + + if (! devread (REISERFS_DISK_OFFSET_IN_BYTES >> SECTOR_BITS, 0, sizeof (struct reiserfs_super_block), (char *) &super)) return 0; - + *start_sector = 1; /* reserve first sector for stage1 */ if ((substring (REISERFS_SUPER_MAGIC_STRING, super.s_magic) <= 0 || substring (REISER2FS_SUPER_MAGIC_STRING, super.s_magic) <= 0 || substring (REISER3FS_SUPER_MAGIC_STRING, super.s_magic) <= 0) && (/* check that this is not a super block copy inside * the journal log */ - super.s_journal_block * super.s_blocksize + super.s_journal_block * super.s_blocksize > REISERFS_DISK_OFFSET_IN_BYTES)) num_sectors = (REISERFS_DISK_OFFSET_IN_BYTES >> SECTOR_BITS) - 1; else num_sectors = (REISERFS_OLD_DISK_OFFSET_IN_BYTES >> SECTOR_BITS) - 1; - + return (needed_sectors <= num_sectors); }
diff --git a/fs/fsys_squashfs.c b/fs/fsys_squashfs.c index 5dec882..227e848 100644 --- a/fs/fsys_squashfs.c +++ b/fs/fsys_squashfs.c @@ -25,7 +25,7 @@ #define SUPERBLOCK ((struct squashfs_super_block *) (FSYS_BUF)) #define INODE_DATA ((union squashfs_inode_header *)\ ((int)SUPERBLOCK + (((sizeof(struct squashfs_super_block)>>5)+1)*32))) -/* +/* * We need to allocate two buffers of SQUASHFS_FILE_MAX_SIZE. * One will be used to lad the compressed data (that can be as large as * SQUASHFS_FILE_MAX_SIZE) and one that store the uncompressed data. Our @@ -500,7 +500,7 @@ static int squashfs_lookup_directory(int inode_block, * | | \ | | * | | ----|___________________________| * |_________________| - * + * * an inode block is compressed, so the size length of the block is not known * in advance, but an inode block always contains SQUASHFS_METADATA_SIZE length * bytes. diff --git a/fs/fsys_xfs.c b/fs/fsys_xfs.c index c71af98..68e1e5a 100644 --- a/fs/fsys_xfs.c +++ b/fs/fsys_xfs.c @@ -1,5 +1,5 @@ /* fsys_xfs.c - an implementation for the SGI XFS file system */ -/* +/* * GRUB -- GRand Unified Bootloader * Copyright (C) 2001,2002 Free Software Foundation, Inc. * @@ -131,7 +131,7 @@ le64 (__uint64_t x) static xfs_fsblock_t xt_start (xfs_bmbt_rec_32_t *r) { - return (((xfs_fsblock_t)(le32 (r->l1) & mask32lo(9))) << 43) | + return (((xfs_fsblock_t)(le32 (r->l1) & mask32lo(9))) << 43) | (((xfs_fsblock_t)le32 (r->l2)) << 11) | (((xfs_fsblock_t)le32 (r->l3)) >> 21); } @@ -358,7 +358,7 @@ next_dentry (xfs_ino_t *ino) ++name; ++namelen; sfe = (xfs_dir2_sf_entry_t *) - (inode->di_u.di_c + (inode->di_u.di_c + sizeof(xfs_dir2_sf_hdr_t) - xfs.i8param); break; @@ -455,7 +455,7 @@ xfs_mount (void)
if (!devread (0, 0, sizeof(super), (char *)&super) || (le32(super.sb_magicnum) != XFS_SB_MAGIC) - || ((le16(super.sb_versionnum) + || ((le16(super.sb_versionnum) & XFS_SB_VERSION_NUMBITS) != XFS_SB_VERSION_4) ) { return 0; } @@ -502,7 +502,7 @@ xfs_read (char *buf, int len) offset = xad->offset; xadlen = xad->len; if (isinxt (filepos >> xfs.blklog, offset, xadlen)) { - endofcur = (offset + xadlen) << xfs.blklog; + endofcur = (offset + xadlen) << xfs.blklog; toread = (endofcur >= endpos) ? len : (endofcur - filepos);
@@ -524,7 +524,7 @@ xfs_read (char *buf, int len) } continue; } - endofprev = offset + xadlen; + endofprev = offset + xadlen; }
return filepos - startpos; diff --git a/fs/jfs.h b/fs/jfs.h index 85a286e..a20aa8b 100644 --- a/fs/jfs.h +++ b/fs/jfs.h @@ -1,21 +1,21 @@ /* jfs.h - an extractions from linux/include/linux/jfs/jfs* into one file */ -/* +/* * GRUB -- GRand Unified Bootloader * Copyright (C) 2000 International Business Machines Corp. * Copyright (C) 2001 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
@@ -175,7 +175,7 @@ struct jfs_superblock s64 s_size; /* 8: aggregate size in hardware/LVM blocks; * VFS: number of blocks */ - s32 s_bsize; /* 4: aggregate block size in bytes; + s32 s_bsize; /* 4: aggregate block size in bytes; * VFS: fragment size */ s16 s_l2bsize; /* 2: log2 of s_bsize */ @@ -189,7 +189,7 @@ struct jfs_superblock u32 s_flag; /* 4: aggregate attributes: * see jfs_filsys.h */ - u32 s_state; /* 4: mount/unmount/recovery state: + u32 s_state; /* 4: mount/unmount/recovery state: * see jfs_filsys.h */ s32 s_compress; /* 4: > 0 if data compression */ @@ -210,11 +210,11 @@ struct jfs_superblock struct timestruc_t s_time; /* 8: time last updated */
s32 s_fsckloglen; /* 4: Number of filesystem blocks reserved for - * the fsck service log. + * the fsck service log. * N.B. These blocks are divided among the * versions kept. This is not a per * version size. - * N.B. These blocks are included in the + * N.B. These blocks are included in the * length field of s_fsckpxd. */ s8 s_fscklog; /* 1: which fsck service log is most recent @@ -222,7 +222,7 @@ struct jfs_superblock * 1 => the first one * 2 => the 2nd one */ - char s_fpack[11]; /* 11: file system volume name + char s_fpack[11]; /* 11: file system volume name * N.B. This must be 11 bytes to * conform with the OS/2 BootSector * requirements @@ -235,7 +235,7 @@ struct jfs_superblock /* - 128 byte boundary - */
/* - * DFS VFS support (preliminary) + * DFS VFS support (preliminary) */ char s_attach; /* 1: VFS: flag: set when aggregate is attached */ @@ -244,22 +244,22 @@ struct jfs_superblock u64 totalUsable; /* 8: VFS: total of 1K blocks which are * available to "normal" (non-root) users. */ - u64 minFree; /* 8: VFS: # of 1K blocks held in reserve for + u64 minFree; /* 8: VFS: # of 1K blocks held in reserve for * exclusive use of root. This value can be 0, - * and if it is then totalUsable will be equal + * and if it is then totalUsable will be equal * to # of blocks in aggregate. I believe this * means that minFree + totalUsable = # blocks. - * In that case, we don't need to store both + * In that case, we don't need to store both * totalUsable and minFree since we can compute - * one from the other. I would guess minFree - * would be the one we should store, and - * totalUsable would be the one we should + * one from the other. I would guess minFree + * would be the one we should store, and + * totalUsable would be the one we should * compute. (Just a guess...) */
- u64 realFree; /* 8: VFS: # of free 1K blocks can be used by + u64 realFree; /* 8: VFS: # of free 1K blocks can be used by * "normal" users. It may be this is something - * we should compute when asked for instead of + * we should compute when asked for instead of * storing in the superblock. I don't know how * often this information is needed. */ @@ -316,7 +316,7 @@ typedef struct {
/* * dir_table used for directory traversal during readdir -*/ +*/
/* * Maximum entry in inline directory table @@ -560,8 +560,8 @@ typedef struct dinode dinode_t;
/* * inode allocation map: - * - * inode allocation map consists of + * + * inode allocation map consists of * . the inode map control page and * . inode allocation group pages (per 4096 inodes) * which are addressed by standard JFS xtree. diff --git a/fs/mini_inflate.c b/fs/mini_inflate.c index eae371d..26800d4 100644 --- a/fs/mini_inflate.c +++ b/fs/mini_inflate.c @@ -28,7 +28,7 @@ /* The order that the code lengths in section 3.2.7 are in */ static unsigned char huffman_order[] = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - + inline void cramfs_memset(int *s, const int c, size_t n) { n--; @@ -71,24 +71,24 @@ static void init_stream(struct bitstream *stream, unsigned char *data, stream->distance.symbols = stream->distance_symbols; stream->distance.count = stream->distance_count; stream->distance.first = stream->distance_first; - stream->distance.pos = stream->distance_pos; + stream->distance.pos = stream->distance_pos;
}
/* pull 'bits' bits out of the stream. The last bit pulled it returned as the * msb. (section 3.1.1) */ -inline unsigned long pull_bits(struct bitstream *stream, +inline unsigned long pull_bits(struct bitstream *stream, const unsigned int bits) { unsigned long ret; int i; - + ret = 0; for (i = 0; i < bits; i++) { ret += ((*(stream->data) >> stream->bit) & 1) << i; - - /* if, before incrementing, we are on bit 7, + + /* if, before incrementing, we are on bit 7, * go to the lsb of the next byte */ if (stream->bit++ == 7) { stream->bit = 0; @@ -126,7 +126,7 @@ static void decompress_none(struct bitstream *stream, unsigned char *dest) length = *(stream->data++); length += *(stream->data++) << 8; pull_bits(stream, 16); /* throw away the inverse of the size */ - + stream->decoded += length; stream->memcpy(dest, stream->data, length); stream->data += length; @@ -137,7 +137,7 @@ static int read_symbol(struct bitstream *stream, struct huffman_set *set) { int bits = 0; int code = 0; - while (!(set->count[bits] && code < set->first[bits] + + while (!(set->count[bits] && code < set->first[bits] + set->count[bits])) { code = (code << 1) + pull_bit(stream); if (++bits > set->bits) { @@ -147,7 +147,7 @@ static int read_symbol(struct bitstream *stream, struct huffman_set *set) } } return set->symbols[set->pos[bits] + code - set->first[bits]]; -} +}
/* decompress a stream of data encoded with the passed length and distance * huffman codes */ @@ -155,28 +155,28 @@ static void decompress_huffman(struct bitstream *stream, unsigned char *dest) { struct huffman_set *lengths = &(stream->lengths); struct huffman_set *distance = &(stream->distance); - + int symbol, length, dist, i; - + do { if ((symbol = read_symbol(stream, lengths)) < 0) return; if (symbol < 256) { *(dest++) = symbol; /* symbol is a literal */ stream->decoded++; } else if (symbol > 256) { - /* Determine the length of the repitition + /* Determine the length of the repitition * (section 3.2.5) */ if (symbol < 265) length = symbol - 254; else if (symbol == 285) length = 258; else { length = pull_bits(stream, (symbol - 261) >> 2); length += (4 << ((symbol - 261) >> 2)) + 3; - length += ((symbol - 1) % 4) << + length += ((symbol - 1) % 4) << ((symbol - 261) >> 2); } - + /* Determine how far back to go */ - if ((symbol = read_symbol(stream, distance)) < 0) + if ((symbol = read_symbol(stream, distance)) < 0) return; if (symbol < 4) dist = symbol + 1; else { @@ -192,12 +192,12 @@ static void decompress_huffman(struct bitstream *stream, unsigned char *dest) } } while (symbol != 256); /* 256 is the end of the data block */ } - + /* Fill the lookup tables (section 3.2.2) */ static void fill_code_tables(struct huffman_set *set) { int code = 0, i, length; - + /* fill in the first code of each bit length, and the pos pointer */ set->pos[0] = 0; for (i = 1; i < set->bits; i++) { @@ -205,20 +205,20 @@ static void fill_code_tables(struct huffman_set *set) set->first[i] = code; set->pos[i] = set->pos[i - 1] + set->count[i - 1]; } - + /* Fill in the table of symbols in order of their huffman code */ for (i = 0; i < set->num_symbols; i++) { if ((length = set->lengths[i])) set->symbols[set->pos[length]++] = i; } - + /* reset the pos pointer */ for (i = 1; i < set->bits; i++) set->pos[i] -= set->count[i]; }
static void init_code_tables(struct huffman_set *set) { - cramfs_memset(set->lengths, 0, set->num_symbols); + cramfs_memset(set->lengths, 0, set->num_symbols); cramfs_memset(set->count, 0, set->bits); cramfs_memset(set->first, 0, set->bits); } @@ -235,32 +235,32 @@ static void decompress_dynamic(struct bitstream *stream, unsigned char *dest) * code (the pos element points to the first place in the symbol table * where that bit length occurs). I also hate the initization of these * structs, if someone knows how to compact these, lemme know. */ - + struct huffman_set *codes = &(stream->codes); struct huffman_set *lengths = &(stream->lengths); struct huffman_set *distance = &(stream->distance); - + int hlit = pull_bits(stream, 5) + 257; int hdist = pull_bits(stream, 5) + 1; int hclen = pull_bits(stream, 4) + 4; int length, curr_code, symbol, i, last_code; - + last_code = 0; - + init_code_tables(codes); init_code_tables(lengths); init_code_tables(distance); - - /* fill in the count of each bit length' as well as the lengths + + /* fill in the count of each bit length' as well as the lengths * table */ for (i = 0; i < hclen; i++) { length = pull_bits(stream, 3); - codes->lengths[huffman_order[i]] = length; + codes->lengths[huffman_order[i]] = length; if (length) codes->count[length]++; - + } fill_code_tables(codes); - + /* Do the same for the length codes, being carefull of wrap through * to the distance table */ curr_code = 0; @@ -278,7 +278,7 @@ static void decompress_dynamic(struct bitstream *stream, unsigned char *dest) length = 3 + pull_bits(stream, 2); for (;length; length--, curr_code++) if (curr_code < hlit) { - lengths->lengths[curr_code] = + lengths->lengths[curr_code] = last_code; lengths->count[last_code]++; } else { /* wrap to the distance table */ @@ -328,14 +328,14 @@ static void decompress_dynamic(struct bitstream *stream, unsigned char *dest) decompress_huffman(stream, dest); }
-/* fill in the length and distance huffman codes for fixed encoding +/* fill in the length and distance huffman codes for fixed encoding * (section 3.2.6) */ static void decompress_fixed(struct bitstream *stream, unsigned char *dest) { /* let gcc fill in the initial values */ struct huffman_set *lengths = &(stream->lengths); struct huffman_set *distance = &(stream->distance); - + cramfs_memset(lengths->count, 0, 16); cramfs_memset(lengths->first, 0, 16); cramfs_memset(lengths->lengths, 8, 144); @@ -350,12 +350,12 @@ static void decompress_fixed(struct bitstream *stream, unsigned char *dest) cramfs_memset(distance->first, 0, 16); cramfs_memset(distance->lengths, 5, 32); distance->count[5] = 32; - - + + fill_code_tables(lengths); fill_code_tables(distance); - - + + decompress_huffman(stream, dest); }
@@ -367,24 +367,24 @@ long decompress_block(unsigned char *dest, unsigned char *source, { int bfinal, btype; struct bitstream stream; - + init_stream(&stream, source, inflate_memcpy); do { bfinal = pull_bit(&stream); btype = pull_bits(&stream, 2); if (btype == NO_COMP) decompress_none(&stream, dest + stream.decoded); - else if (btype == DYNAMIC_COMP) + else if (btype == DYNAMIC_COMP) decompress_dynamic(&stream, dest + stream.decoded); else if (btype == FIXED_COMP) decompress_fixed(&stream, dest + stream.decoded); else stream.error = COMP_UNKNOWN; } while (!bfinal && !stream.error);
#if 0 - putstr("decompress_block start\r\n"); + putstr("decompress_block start\r\n"); putLabeledWord("stream.error = ",stream.error); putLabeledWord("stream.decoded = ",stream.decoded); putLabeledWord("dest = ",dest); - putstr("decompress_block end\r\n"); + putstr("decompress_block end\r\n"); #endif return stream.error ? -stream.error : stream.decoded; } diff --git a/fs/mini_inflate.h b/fs/mini_inflate.h index 6c31de5..068d621 100644 --- a/fs/mini_inflate.h +++ b/fs/mini_inflate.h @@ -22,12 +22,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ - + #define NO_ERROR 0 #define COMP_UNKNOWN 1 /* The specififed bytype is invalid */ #define CODE_NOT_FOUND 2 /* a huffman code in the stream could not be decoded */ -#define TOO_MANY_BITS 3 /* pull_bits was passed an argument that is too - * large */ +#define TOO_MANY_BITS 3 /* pull_bits was passed an argument that is too + * large */
/* This struct represents an entire huffman code set. It has various lookup * tables to speed decoding */ @@ -60,18 +60,18 @@ struct bitstream { int code_pos[8]; int code_lengths[19]; int code_symbols[19]; - + int length_count[16]; int length_first[16]; int length_pos[16]; int length_lengths[288]; int length_symbols[288]; - + struct huffman_set codes; struct huffman_set lengths; struct huffman_set distance; }; - + #define NO_COMP 0 #define FIXED_COMP 1 #define DYNAMIC_COMP 2 diff --git a/fs/squashfs_fs.h b/fs/squashfs_fs.h index d561edb..a414a60 100644 --- a/fs/squashfs_fs.h +++ b/fs/squashfs_fs.h @@ -233,7 +233,7 @@ struct squashfs_dev_inode_header { unsigned int nlink; unsigned short rdev; } __attribute__ ((packed)); - + struct squashfs_symlink_inode_header { SQUASHFS_BASE_INODE_HEADER; unsigned int nlink; @@ -290,7 +290,7 @@ union squashfs_inode_header { struct squashfs_ldir_inode_header ldir; struct squashfs_ipc_inode_header ipc; }; - + struct squashfs_dir_entry { unsigned int offset:13; unsigned int type:3; @@ -540,7 +540,7 @@ struct squashfs_dev_inode_header_1 { unsigned int guid:4; /* index into guid table */ unsigned short rdev; } __attribute__ ((packed)); - + struct squashfs_symlink_inode_header_1 { unsigned int inode_type:4; unsigned int mode:12; /* protection */ @@ -657,7 +657,7 @@ struct squashfs_dev_inode_header_2 { unsigned int guid:8; /* index into guid table */ unsigned short rdev; } __attribute__ ((packed)); - + struct squashfs_symlink_inode_header_2 { unsigned int inode_type:4; unsigned int mode:12; /* protection */ @@ -713,7 +713,7 @@ union squashfs_inode_header_2 { struct squashfs_ldir_inode_header_2 ldir; struct squashfs_ipc_inode_header_2 ipc; }; - + struct squashfs_dir_header_2 { unsigned int count:8; unsigned int start_block:24; @@ -854,7 +854,7 @@ struct squashfs_fragment_entry_2 { #define SQUASHFS_SWAP(value, p, pos, tbits) _SQUASHFS_SWAP(value, p, pos, \ tbits, b_pos) #else - /* convert from big endian to little endian */ + /* convert from big endian to little endian */ #define SQUASHFS_SWAP(value, p, pos, tbits) _SQUASHFS_SWAP(value, p, pos, \ tbits, 64 - tbits - b_pos) #endif diff --git a/fs/squashfs_zlib.h b/fs/squashfs_zlib.h index 0e5a107..06d1e04 100644 --- a/fs/squashfs_zlib.h +++ b/fs/squashfs_zlib.h @@ -4,7 +4,7 @@
/* zconf.h -- configuration of the zlib compression library * Copyright (C) 1995-1998 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h + * For conditions of distribution and use, see copyright notice in zlib.h */
/* @(#) $Id$ */ @@ -108,7 +108,7 @@ typedef void *voidp; zlib_inflate itself to inflate the data. */
-/* +/* The 'zlib' compression library provides in-memory compression and decompression functions, including integrity checks of the uncompressed data. This version of the library supports only one compression method @@ -245,7 +245,7 @@ extern int zlib_deflate_workspacesize (void); returned in stream->workspace before calling zlib_deflateInit(). */
-/* +/* extern int deflateInit (z_streamp strm, int level);
Initializes the internal stream state for compression. The fields @@ -323,7 +323,7 @@ extern int zlib_deflate (z_streamp strm, int flush); more input data, until it returns with Z_STREAM_END or an error. After deflate has returned Z_STREAM_END, the only possible operations on the stream are deflateReset or deflateEnd. - + Z_FINISH can be used immediately after deflateInit if all the compression is to be done in a single step. In this case, avail_out must be at least 0.1% larger than avail_in plus 12 bytes. If deflate does not return @@ -367,7 +367,7 @@ extern int zlib_inflate_workspacesize (void); returned in stream->workspace before calling zlib_inflateInit(). */
-/* +/* extern int zlib_inflateInit (z_streamp strm);
Initializes the internal stream state for decompression. The fields @@ -504,7 +504,7 @@ extern int zlib_inflateEnd (z_streamp strm); The following functions are needed only in some special applications. */
-/* +/* extern int deflateInit2 (z_streamp strm, int level, int method, @@ -547,7 +547,7 @@ extern int deflateInit2 (z_streamp strm, method). msg is set to null if there is no error message. deflateInit2 does not perform any compression: this will be done by deflate(). */ - + #if 0 extern int zlib_deflateSetDictionary (z_streamp strm, const Byte *dictionary, @@ -643,7 +643,7 @@ extern int zlib_deflateParams (z_streamp strm, int level, int strategy); if strm->avail_out was zero. */
-/* +/* extern int inflateInit2 (z_streamp strm, int windowBits);
This is another version of inflateInit with an extra parameter. The @@ -710,7 +710,7 @@ extern int zlib_inflateSetDictionary (z_streamp strm, #if 0 extern int zlib_inflateSync (z_streamp strm); #endif -/* +/* Skips invalid compressed data until a full flush point (see above the description of deflate with Z_FULL_FLUSH) can be found, or until all available input is skipped. No output is provided. @@ -1033,7 +1033,7 @@ struct inflate_state {
/* infutil.h -- types and macros common to blocks and codes * Copyright (C) 1995-1998 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h + * For conditions of distribution and use, see copyright notice in zlib.h */
/* WARNING: this file should *not* be used by applications. It is diff --git a/fs/xfs.h b/fs/xfs.h index 6a2f8fe..ae48969 100644 --- a/fs/xfs.h +++ b/fs/xfs.h @@ -1,35 +1,35 @@ /* xfs.h - an extraction from xfsprogs-1.3.5/include/xfs* into one file */ -/* +/* * GRUB -- GRand Unified Bootloader * Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved. * Copyright (C) 2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. - * + * * This program is distributed in the hope that it would be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * + * * Further, this software is distributed without any warranty that it is * free of the rightful claim of any third person regarding infringement * or the like. Any license provided herein, whether implied or * otherwise, applies only to this software file. Patent licenses, if * any, provided herein do not apply to combinations of this program with * other software, or any other product whatsoever. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston MA 02111-1307, USA. - * + * * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, * Mountain View, CA 94043, or: - * - * http://www.sgi.com - * - * For further information regarding this notice, see: - * + * + * http://www.sgi.com + * + * For further information regarding this notice, see: + * * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */
@@ -132,7 +132,7 @@ typedef struct xfs_sb __uint8_t sb_shared_vn; /* shared version number */ xfs_extlen_t sb_inoalignmt; /* inode chunk alignment, fsblocks */ __uint32_t sb_unit; /* stripe or raid unit */ - __uint32_t sb_width; /* stripe or raid width */ + __uint32_t sb_width; /* stripe or raid width */ __uint8_t sb_dirblklog; /* log2 of dir block size (fsbs) */ __uint8_t sb_dummy[7]; /* padding */ } xfs_sb_t; diff --git a/include/elf_boot.h b/include/elf_boot.h index 4f253e2..559922b 100644 --- a/include/elf_boot.h +++ b/include/elf_boot.h @@ -16,8 +16,8 @@ */
-#ifndef ELF_BOOT_H -#define ELF_BOOT_H +#ifndef ELF_BOOT_H +#define ELF_BOOT_H
/* This defines the structure of a table of parameters useful for ELF @@ -52,7 +52,7 @@ typedef struct Elf_Bhdr Elf_Half b_records; } Elf_Bhdr;
-/* +/* * ELF Notes. */
diff --git a/main/Makefile.inc b/main/Makefile.inc index 1d4029d..c8296f9 100644 --- a/main/Makefile.inc +++ b/main/Makefile.inc @@ -1,6 +1,6 @@ # -# Copyright (C) 2008 by coresystems GmbH -# +# Copyright (C) 2008 by coresystems GmbH +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -19,7 +19,7 @@ include main/grub/Makefile.inc
TARGETS-y += main/filo.o main/strtox.o -TARGETS-y += main/elfload.o main/ipchecksum.o +TARGETS-y += main/elfload.o main/ipchecksum.o TARGETS-y += main/timer.o TARGETS-$(CONFIG_SUPPORT_SOUND) += main/sound.o TARGETS-$(CONFIG_MULTIBOOT_IMAGE) += main/mb_hdr.o diff --git a/main/elfload.c b/main/elfload.c index 7aa8a2e..15e68aa 100644 --- a/main/elfload.c +++ b/main/elfload.c @@ -155,7 +155,7 @@ static int load_segments(Elf_phdr *phdr, int phnum, } bytes += phdr[i].p_filesz; debug("clearing... "); - memset(phys_to_virt(phdr[i].p_paddr + phdr[i].p_filesz), 0, + memset(phys_to_virt(phdr[i].p_paddr + phdr[i].p_filesz), 0, phdr[i].p_memsz - phdr[i].p_filesz); if (phdr[i].p_offset <= checksum_offset && phdr[i].p_offset + phdr[i].p_filesz >= checksum_offset+2) { @@ -364,7 +364,7 @@ int elf_load(const char *filename, const char *cmdline) }
file_close(); - + boot_notes = build_boot_notes(cmdline);
#if CONFIG_PCMCIA_CF diff --git a/main/filo.c b/main/filo.c index 1855f08..c8f65e2 100644 --- a/main/filo.c +++ b/main/filo.c @@ -116,7 +116,7 @@ int boot(const char *line) /* If the boot command is successful, the loader * function will not return. * - * If the loader is not supported, or it recognized + * If the loader is not supported, or it recognized * that it does not match for the given file type, it * will return LOADER_NOT_SUPPORT. * @@ -153,12 +153,12 @@ int main(void) { void grub_menulst(void); void grub_main(void); - + /* Initialize */ init(); grub_menulst(); grub_main(); - return 0; + return 0; }
#else // ! CONFIG_USE_GRUB @@ -174,7 +174,7 @@ static inline int autoboot_delay(void) u64 timeout; int sec, tmp; char key; - + key = 0;
printf("Press <Enter> for default boot, or <Esc> for boot prompt... "); @@ -227,7 +227,7 @@ int main(void)
/* Initialize */ init(); - + /* Try default image */ autoboot();
diff --git a/main/grub/Makefile.inc b/main/grub/Makefile.inc index 00273f3..20d0fdd 100644 --- a/main/grub/Makefile.inc +++ b/main/grub/Makefile.inc @@ -1,6 +1,6 @@ # -# Copyright (C) 2008 by coresystems GmbH -# +# Copyright (C) 2008 by coresystems GmbH +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or diff --git a/main/grub/builtins.c b/main/grub/builtins.c index e6651d5..e556eb1 100644 --- a/main/grub/builtins.c +++ b/main/grub/builtins.c @@ -394,7 +394,7 @@ static int default_func(char *arg, int flags) unsigned char buf[1]; if (get_option(buf, "boot_default")) buf[0] = 0xff; - + if ((unsigned char)buf[0] != 0xff) { printf("Default override by CMOS.\n"); return 0; @@ -519,7 +519,7 @@ static int find_func(char *arg, int flags) int got_file = 0;
// the grub find works like this: - // + // // for all disks // for all partitions on disk // open file @@ -1379,7 +1379,7 @@ static struct builtin builtin_poweroff = { #ifdef CONFIG_DEVELOPER_TOOLS static int probe_func(char *arg, int flags) { -#if CONFIG_IDE_DISK +#if CONFIG_IDE_DISK int i;
for (i=0; i<8; i++) diff --git a/main/grub/grub.c b/main/grub/grub.c index 67efdb6..37c25ca 100644 --- a/main/grub/grub.c +++ b/main/grub/grub.c @@ -493,7 +493,7 @@ static void run_menu(char *menu_entries, char *config_entries, int num_entries,
/* Check for a keypress, however if TIMEOUT has been expired (GRUB_TIMEOUT == -1) relax in GETKEY even if no key has been - pressed. + pressed. This avoids polling (relevant in the grub-shell and later on in grub if interrupt driven I/O is done). */ if (checkkey() >= 0 || grub_timeout < 0) { @@ -962,7 +962,7 @@ static int rewrite_isolinux_config(void) // Our kernel has an absolute path, so // we only grab the device portion of the // config file - + // (hd0,0)/configfile.cfg or hda1:/configfile.cfg spos = strchr(config_file, '/'); if (!spos) { @@ -1241,7 +1241,7 @@ restart: }
/* Check if the default entry is present. Otherwise reset - * it to fallback if fallback is valid, or to DEFAULT_ENTRY + * it to fallback if fallback is valid, or to DEFAULT_ENTRY * if not. */ if (default_entry >= num_entries) { diff --git a/main/ipchecksum.c b/main/ipchecksum.c index baa4ded..b00ae1f 100644 --- a/main/ipchecksum.c +++ b/main/ipchecksum.c @@ -59,7 +59,7 @@ unsigned short add_ipchksums(unsigned long offset, unsigned short sum, unsigned sum = ~sum & 0xFFFF; new = ~new & 0xFFFF; if (offset & 1) { - /* byte swap the sum if it came from an odd offset + /* byte swap the sum if it came from an odd offset * since the computation is endian independant this * works. */ diff --git a/util/artecimage.c b/util/artecimage.c index ee282cc..eba48e2 100644 --- a/util/artecimage.c +++ b/util/artecimage.c @@ -104,7 +104,7 @@ int main(int argc, char **argv){ verbose = 1; break; } - } + } if(!BINFILE){ usage(); printf("\nError: No output file specified\n\n"); @@ -147,7 +147,7 @@ int main(int argc, char **argv){ fwrite(&bootHdr, 1, sizeof(ARTECBOOT_HEADER), BINFILE); fseek(BINFILE, bootHdr.kernelStart, SEEK_SET);
- /* Copy kernel into output file */ + /* Copy kernel into output file */ fseek(KERNFILE, 0, SEEK_SET); while((i = fread(&buf, 1, BUFSIZE, KERNFILE)) != 0){ fwrite(&buf, 1, i, BINFILE); @@ -166,7 +166,7 @@ int main(int argc, char **argv){ }
fclose(BINFILE); - + if(verbose){ printf("magicHeader: 0x%04lx\n", bootHdr.magicHeader); printf("bootVersion: 0x%04x\n", bootHdr.bootVersion); diff --git a/util/kconfig/confdata.c b/util/kconfig/confdata.c index 77f8dbe..843f030 100644 --- a/util/kconfig/confdata.c +++ b/util/kconfig/confdata.c @@ -19,7 +19,7 @@ #define mkdir(x,y) mkdir(x) #define UNLINK_IF_NECESSARY(x) unlink(x) #else -#define UNLINK_IF_NECESSARY(X) +#define UNLINK_IF_NECESSARY(X) #endif
static void conf_warning(const char *fmt, ...) diff --git a/util/kconfig/lex.zconf.c_shipped b/util/kconfig/lex.zconf.c_shipped index 1911092..6897092 100644 --- a/util/kconfig/lex.zconf.c_shipped +++ b/util/kconfig/lex.zconf.c_shipped @@ -52,7 +52,7 @@ #if __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -69,7 +69,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ @@ -179,7 +179,7 @@ extern FILE *zconfin, *zconfout; #define EOB_ACT_LAST_MATCH 2
#define YY_LESS_LINENO(n) - + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -246,7 +246,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -866,7 +866,7 @@ extern int zconfwrap (void ); #endif
static void yyunput (int c,char *buf_ptr ); - + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -971,7 +971,7 @@ YY_DECL register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; - + int str = 0; int ts, i;
@@ -1574,7 +1574,7 @@ static int yy_get_next_buffer (void) { register yy_state_type yy_current_state; register char *yy_cp; - + yy_current_state = (yy_start);
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) @@ -1593,7 +1593,7 @@ static int yy_get_next_buffer (void) static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; - + yy_current_state = yy_nxt[yy_current_state][1]; yy_is_jam = (yy_current_state <= 0);
@@ -1603,7 +1603,7 @@ static int yy_get_next_buffer (void) static void yyunput (int c, register char * yy_bp ) { register char *yy_cp; - + yy_cp = (yy_c_buf_p);
/* undo effects of setting up zconftext */ @@ -1646,7 +1646,7 @@ static int yy_get_next_buffer (void)
{ int c; - + *(yy_c_buf_p) = (yy_hold_char);
if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) @@ -1713,12 +1713,12 @@ static int yy_get_next_buffer (void)
/** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ void zconfrestart (FILE * input_file ) { - + if ( ! YY_CURRENT_BUFFER ){ zconfensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = @@ -1731,11 +1731,11 @@ static int yy_get_next_buffer (void)
/** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - + /* TODO. We should be able to replace this entire function body * with * zconfpop_buffer_state(); @@ -1775,13 +1775,13 @@ static void zconf_load_buffer_state (void) /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ YY_BUFFER_STATE zconf_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" ); @@ -1804,11 +1804,11 @@ static void zconf_load_buffer_state (void)
/** Destroy the buffer. * @param b a buffer created with zconf_create_buffer() - * + * */ void zconf_delete_buffer (YY_BUFFER_STATE b ) { - + if ( ! b ) return;
@@ -1829,7 +1829,7 @@ static void zconf_load_buffer_state (void)
{ int oerrno = errno; - + zconf_flush_buffer(b );
b->yy_input_file = file; @@ -1845,13 +1845,13 @@ static void zconf_load_buffer_state (void) }
b->yy_is_interactive = 0; - + errno = oerrno; }
/** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ void zconf_flush_buffer (YY_BUFFER_STATE b ) { @@ -1880,7 +1880,7 @@ static void zconf_load_buffer_state (void) * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer ) { @@ -1910,7 +1910,7 @@ void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
/** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ void zconfpop_buffer_state (void) { @@ -1934,7 +1934,7 @@ void zconfpop_buffer_state (void) static void zconfensure_buffer_stack (void) { int num_to_alloc; - + if (!(yy_buffer_stack)) {
/* First allocation is just for 2 elements, since we don't know if this @@ -1945,9 +1945,9 @@ static void zconfensure_buffer_stack (void) (yy_buffer_stack) = (struct yy_buffer_state**)zconfalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); - + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; @@ -1973,13 +1973,13 @@ static void zconfensure_buffer_stack (void) /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. + * + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) @@ -2008,14 +2008,14 @@ YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size ) /** Setup the input buffer state to scan a string. The next call to zconflex() will * scan from a @e copy of @a str. * @param str a NUL-terminated string to scan - * + * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * zconf_scan_bytes() instead. */ YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr ) { - + return zconf_scan_bytes(yystr,strlen(yystr) ); }
@@ -2023,7 +2023,7 @@ YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr ) * scan from a @e copy of @a bytes. * @param bytes the byte buffer to scan * @param len the number of bytes in the buffer pointed to by @a bytes. - * + * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE zconf_scan_bytes (yyconst char * yybytes, int _yybytes_len ) @@ -2032,7 +2032,7 @@ YY_BUFFER_STATE zconf_scan_bytes (yyconst char * yybytes, int _yybytes_len ) char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) zconfalloc(n ); @@ -2086,16 +2086,16 @@ static void yy_fatal_error (yyconst char* msg ) /* Accessor methods (get/set functions) to struct members. */
/** Get the current line number. - * + * */ int zconfget_lineno (void) { - + return zconflineno; }
/** Get the input stream. - * + * */ FILE *zconfget_in (void) { @@ -2103,7 +2103,7 @@ FILE *zconfget_in (void) }
/** Get the output stream. - * + * */ FILE *zconfget_out (void) { @@ -2111,7 +2111,7 @@ FILE *zconfget_out (void) }
/** Get the length of the current token. - * + * */ int zconfget_leng (void) { @@ -2119,7 +2119,7 @@ int zconfget_leng (void) }
/** Get the current token. - * + * */
char *zconfget_text (void) @@ -2129,18 +2129,18 @@ char *zconfget_text (void)
/** Set the current line number. * @param line_number - * + * */ void zconfset_lineno (int line_number ) { - + zconflineno = line_number; }
/** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. - * + * * @see zconf_switch_to_buffer */ void zconfset_in (FILE * in_str ) @@ -2194,7 +2194,7 @@ static int yy_init_globals (void) /* zconflex_destroy is for both reentrant and non-reentrant scanners. */ int zconflex_destroy (void) { - + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ zconf_delete_buffer(YY_CURRENT_BUFFER ); diff --git a/util/kconfig/lxdialog/BIG.FAT.WARNING b/util/kconfig/lxdialog/BIG.FAT.WARNING index a8999d8..7cb5a7e 100644 --- a/util/kconfig/lxdialog/BIG.FAT.WARNING +++ b/util/kconfig/lxdialog/BIG.FAT.WARNING @@ -1,4 +1,4 @@ This is NOT the official version of dialog. This version has been significantly modified from the original. It is for use by the Linux -kernel configuration script. Please do not bother Savio Lam with +kernel configuration script. Please do not bother Savio Lam with questions about this program. diff --git a/util/kconfig/lxdialog/menubox.c b/util/kconfig/lxdialog/menubox.c index fa9d633..c689fc0 100644 --- a/util/kconfig/lxdialog/menubox.c +++ b/util/kconfig/lxdialog/menubox.c @@ -26,7 +26,7 @@ * * *) A bugfix for the Page-Down problem * - * *) Formerly when I used Page Down and Page Up, the cursor would be set + * *) Formerly when I used Page Down and Page Up, the cursor would be set * to the first position in the menu box. Now lxdialog is a bit * smarter and works more like other menu systems (just have a look at * it). diff --git a/util/kconfig/regex.c b/util/kconfig/regex.c index 8169880..b541e8d 100644 --- a/util/kconfig/regex.c +++ b/util/kconfig/regex.c @@ -75,7 +75,7 @@ char *realloc ();
/* This must be nonzero for the wordchar and notwordchar pattern commands in re_match_2. */ -#ifndef Sword +#ifndef Sword #define Sword 1 #endif
@@ -173,8 +173,8 @@ init_syntax_once () use `alloca' instead of `malloc'. This is because using malloc in re_search* or re_match* could cause memory leaks when C-g is used in Emacs; also, malloc is slower and causes storage fragmentation. On - the other hand, malloc is more portable, and easier to debug. - + the other hand, malloc is more portable, and easier to debug. + Because we sometimes use alloca, some routines have to be macros, not functions -- `alloca'-allocated space disappears at the end of the function it is called in. */ @@ -199,7 +199,7 @@ init_syntax_once () #ifndef _AIX /* Already did AIX, up at the top. */ char *alloca (); #endif /* not _AIX */ -#endif /* not HAVE_ALLOCA_H */ +#endif /* not HAVE_ALLOCA_H */ #endif /* not __GNUC__ */
#endif /* not alloca */ @@ -302,9 +302,9 @@ typedef enum
/* Analogously, for end of buffer/string. */ endbuf, - + /* Followed by two byte relative address to which to jump. */ - jump, + jump,
/* Same as jump, but marks the end of an alternative. */ jump_past_alt, @@ -312,11 +312,11 @@ typedef enum /* Followed by two-byte relative address of place to resume at in case of failure. */ on_failure_jump, - + /* Like on_failure_jump, but pushes a placeholder instead of the current string position when executed. */ on_failure_keep_string_jump, - + /* Throw away latest failure point and then jump to following two-byte relative address. */ pop_failure_jump, @@ -412,7 +412,7 @@ extract_number (dest, source) int *dest; unsigned char *source; { - int temp = SIGN_EXTEND_CHAR (*(source + 1)); + int temp = SIGN_EXTEND_CHAR (*(source + 1)); *dest = *source & 0377; *dest += temp << 8; } @@ -438,7 +438,7 @@ static void extract_number_and_incr (destination, source) int *destination; unsigned char **source; -{ +{ extract_number (destination, *source); *source += 2; } @@ -487,8 +487,8 @@ print_fastmap (fastmap) char *fastmap; { unsigned was_a_range = 0; - unsigned i = 0; - + unsigned i = 0; + while (i < (1 << BYTEWIDTH)) { if (fastmap[i++]) @@ -507,7 +507,7 @@ print_fastmap (fastmap) } } } - putchar ('\n'); + putchar ('\n'); }
@@ -528,7 +528,7 @@ print_partial_compiled_pattern (start, end) printf ("(null)\n"); return; } - + /* Loop over pattern commands. */ while (p < pend) { @@ -574,14 +574,14 @@ print_partial_compiled_pattern (start, end)
printf ("/charset%s", (re_opcode_t) *(p - 1) == charset_not ? "_not" : ""); - + assert (p + *p < pend);
for (c = 0; c < *p; c++) { unsigned bit; unsigned char map_byte = p[1 + c]; - + putchar ('/');
for (bit = 0; bit < BYTEWIDTH; bit++) @@ -618,7 +618,7 @@ print_partial_compiled_pattern (start, end) case push_dummy_failure: printf ("/push_dummy_failure"); break; - + case maybe_pop_jump: extract_number_and_incr (&mcnt, &p); printf ("/maybe_pop_jump/0/%d", mcnt); @@ -627,36 +627,36 @@ print_partial_compiled_pattern (start, end) case pop_failure_jump: extract_number_and_incr (&mcnt, &p); printf ("/pop_failure_jump/0/%d", mcnt); - break; - + break; + case jump_past_alt: extract_number_and_incr (&mcnt, &p); printf ("/jump_past_alt/0/%d", mcnt); - break; - + break; + case jump: extract_number_and_incr (&mcnt, &p); printf ("/jump/0/%d", mcnt); break;
- case succeed_n: + case succeed_n: extract_number_and_incr (&mcnt, &p); extract_number_and_incr (&mcnt2, &p); printf ("/succeed_n/0/%d/0/%d", mcnt, mcnt2); break; - - case jump_n: + + case jump_n: extract_number_and_incr (&mcnt, &p); extract_number_and_incr (&mcnt2, &p); printf ("/jump_n/0/%d/0/%d", mcnt, mcnt2); break; - - case set_number_at: + + case set_number_at: extract_number_and_incr (&mcnt, &p); extract_number_and_incr (&mcnt2, &p); printf ("/set_number_at/0/%d/0/%d", mcnt, mcnt2); break; - + case wordbound: printf ("/wordbound"); break; @@ -668,10 +668,10 @@ print_partial_compiled_pattern (start, end) case wordbeg: printf ("/wordbeg"); break; - + case wordend: printf ("/wordend"); - + #ifdef emacs case before_dot: printf ("/before_dot"); @@ -690,7 +690,7 @@ print_partial_compiled_pattern (start, end) mcnt = *p++; printf ("/%d", mcnt); break; - + case notsyntaxspec: printf ("/notsyntaxspec"); mcnt = *p++; @@ -701,7 +701,7 @@ print_partial_compiled_pattern (start, end) case wordchar: printf ("/wordchar"); break; - + case notwordchar: printf ("/notwordchar"); break; @@ -758,7 +758,7 @@ print_double_string (where, string1, size1, string2, size2) int size2; { unsigned this_char; - + if (where == NULL) printf ("(null)"); else @@ -768,7 +768,7 @@ print_double_string (where, string1, size1, string2, size2) for (this_char = where - string1; this_char < size1; this_char++) printchar (string1[this_char]);
- where = string2; + where = string2; }
for (this_char = where - string2; this_char < size2; this_char++) @@ -809,7 +809,7 @@ re_set_syntax (syntax) reg_syntax_t syntax; { reg_syntax_t ret = re_syntax_options; - + re_syntax_options = syntax; return ret; } @@ -845,7 +845,7 @@ static boolean at_begline_loc_p (), at_endline_loc_p (); static boolean group_in_compile_stack (); static reg_errcode_t compile_range ();
-/* Fetch the next character in the uncompiled pattern---translating it +/* Fetch the next character in the uncompiled pattern---translating it if necessary. Also cast from a signed character in the constant string passed to us by the user to an unsigned char that we can use as an array index (in, e.g., `translate'). */ @@ -985,7 +985,7 @@ typedef struct pattern_offset_t begalt_offset; pattern_offset_t fixup_alt_jump; pattern_offset_t inner_group_offset; - pattern_offset_t laststart_offset; + pattern_offset_t laststart_offset; regnum_t regnum; } compile_stack_elt_t;
@@ -1028,7 +1028,7 @@ typedef struct PATFETCH (c); \ } \ } \ - } + }
#define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
@@ -1054,7 +1054,7 @@ typedef struct `fastmap_accurate' is zero; `re_nsub' is the number of subexpressions in PATTERN; `not_bol' and `not_eol' are zero; - + The `fastmap' and `newline_anchor' fields are neither examined nor set. */
@@ -1069,20 +1069,20 @@ regex_compile (pattern, size, syntax, bufp) `char *' (i.e., signed), we declare these variables as unsigned, so they can be reliably used as array indices. */ register unsigned char c, c1; - + /* A random tempory spot in PATTERN. */ const char *p1;
/* Points to the end of the buffer, where we should append. */ register unsigned char *b; - + /* Keeps track of unclosed groups. */ compile_stack_type compile_stack;
/* Points to the current (ending) position in the pattern. */ const char *p = pattern; const char *pend = pattern + size; - + /* How to translate the characters in the pattern. */ char *translate = bufp->translate;
@@ -1103,7 +1103,7 @@ regex_compile (pattern, size, syntax, bufp) /* Place in the uncompiled pattern (i.e., the {) to which to go back if the interval is invalid. */ const char *beg_interval; - + /* Address of the place where a forward jump should go to the end of the containing expression. Each alternative of an `or' -- except the last -- ends with a forward jump of this sort. */ @@ -1119,7 +1119,7 @@ regex_compile (pattern, size, syntax, bufp) if (debug) { unsigned debug_count; - + for (debug_count = 0; debug_count < size; debug_count++) printchar (pattern[debug_count]); putchar ('\n'); @@ -1143,9 +1143,9 @@ regex_compile (pattern, size, syntax, bufp) printer (for debugging) will think there's no pattern. We reset it at the end. */ bufp->used = 0; - + /* Always count groups, whether or not bufp->no_sub is set. */ - bufp->re_nsub = 0; + bufp->re_nsub = 0;
#if !defined (emacs) && !defined (SYNTAX_TABLE) /* Initialize the syntax table. */ @@ -1196,7 +1196,7 @@ regex_compile (pattern, size, syntax, bufp) case '$': { if ( /* If at end of pattern, it's an operator. */ - p == pend + p == pend /* If context independent, it's an operator. */ || syntax & RE_CONTEXT_INDEP_ANCHORS /* Otherwise, depends on what's next. */ @@ -1227,7 +1227,7 @@ regex_compile (pattern, size, syntax, bufp) { /* Are we optimizing this jump? */ boolean keep_string_p = false; - + /* 1 means zero (many) matches is allowed. */ char zero_times_ok = 0, many_times_ok = 0;
@@ -1275,7 +1275,7 @@ regex_compile (pattern, size, syntax, bufp)
/* Star, etc. applied to an empty pattern is equivalent to an empty pattern. */ - if (!laststart) + if (!laststart) break;
/* Now we know whether or not zero matches is allowed @@ -1284,7 +1284,7 @@ regex_compile (pattern, size, syntax, bufp) { /* More than one repetition is allowed, so put in at the end a backward relative jump from `b' to before the next jump we're going to put in below (which jumps from - laststart to after this jump). + laststart to after this jump).
But if we are at the `*' in the exact sequence `.*\n', insert an unconditional jump backwards to the ., @@ -1361,7 +1361,7 @@ regex_compile (pattern, size, syntax, bufp)
/* We test `*p == '^' twice, instead of using an if statement, so we only need one BUF_PUSH. */ - BUF_PUSH (*p == '^' ? charset_not : charset); + BUF_PUSH (*p == '^' ? charset_not : charset); if (*p == '^') p++;
@@ -1411,8 +1411,8 @@ regex_compile (pattern, size, syntax, bufp) was a character: if this is a hyphen not at the beginning or the end of a list, then it's the range operator. */ - if (c == '-' - && !(p - 2 >= pattern && p[-2] == '[') + if (c == '-' + && !(p - 2 >= pattern && p[-2] == '[') && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^') && *p != ']') { @@ -1427,7 +1427,7 @@ regex_compile (pattern, size, syntax, bufp)
/* Move past the `-'. */ PATFETCH (c1); - + ret = compile_range (&p, pend, translate, syntax, b); if (ret != REG_NOERROR) return ret; } @@ -1456,7 +1456,7 @@ regex_compile (pattern, size, syntax, bufp) str[c1] = '\0';
/* If isn't a word bracketed by `[:' and:`]': - undo the ending character, the letters, and leave + undo the ending character, the letters, and leave the leading `:' and `[' (but set bits for them). */ if (c == ':' && *p == ']') { @@ -1473,12 +1473,12 @@ regex_compile (pattern, size, syntax, bufp) boolean is_space = STREQ (str, "space"); boolean is_upper = STREQ (str, "upper"); boolean is_xdigit = STREQ (str, "xdigit"); - + if (!IS_CHAR_CLASS (str)) return REG_ECTYPE;
/* Throw away the ] at the end of the character class. */ - PATFETCH (c); + PATFETCH (c);
if (p == pend) return REG_EBRACK;
@@ -1503,7 +1503,7 @@ regex_compile (pattern, size, syntax, bufp) else { c1++; - while (c1--) + while (c1--) PATUNFETCH; SET_LIST_BIT ('['); SET_LIST_BIT (':'); @@ -1519,8 +1519,8 @@ regex_compile (pattern, size, syntax, bufp)
/* Discard any (non)matching list bytes that are all 0 at the end of the map. Decrease the map-length byte too. */ - while ((int) b[-1] > 0 && b[b[-1] - 1] == 0) - b[-1]--; + while ((int) b[-1] > 0 && b[b[-1] - 1] == 0) + b[-1]--; b += b[-1]; } break; @@ -1580,7 +1580,7 @@ regex_compile (pattern, size, syntax, bufp) regnum++;
if (COMPILE_STACK_FULL) - { + { RETALLOC (compile_stack.stack, compile_stack.size << 1, compile_stack_elt_t); if (compile_stack.stack == NULL) return REG_ESPACE; @@ -1593,7 +1593,7 @@ regex_compile (pattern, size, syntax, bufp) whole pattern moves because of realloc, they will still be valid. */ COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer; - COMPILE_STACK_TOP.fixup_alt_jump + COMPILE_STACK_TOP.fixup_alt_jump = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0; COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer; COMPILE_STACK_TOP.regnum = regnum; @@ -1607,7 +1607,7 @@ regex_compile (pattern, size, syntax, bufp) COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2; BUF_PUSH_3 (start_memory, regnum, 0); } - + compile_stack.avail++;
fixup_alt_jump = 0; @@ -1636,7 +1636,7 @@ regex_compile (pattern, size, syntax, bufp) `pop_failure_jump' to pop. See comments at `push_dummy_failure' in `re_match_2'. */ BUF_PUSH (push_dummy_failure); - + /* We allocated space for this jump when we assigned to `fixup_alt_jump', in the `handle_alt' case below. */ STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1); @@ -1658,11 +1658,11 @@ regex_compile (pattern, size, syntax, bufp) as in `(ab)c(de)' -- the second group is #2. */ regnum_t this_group_regnum;
- compile_stack.avail--; + compile_stack.avail--; begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset; fixup_alt_jump = COMPILE_STACK_TOP.fixup_alt_jump - ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1 + ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1 : 0; laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset; this_group_regnum = COMPILE_STACK_TOP.regnum; @@ -1677,7 +1677,7 @@ regex_compile (pattern, size, syntax, bufp) { unsigned char *inner_group_loc = bufp->buffer + COMPILE_STACK_TOP.inner_group_offset; - + *inner_group_loc = regnum - this_group_regnum; BUF_PUSH_3 (stop_memory, this_group_regnum, regnum - this_group_regnum); @@ -1706,10 +1706,10 @@ regex_compile (pattern, size, syntax, bufp) jump (put in below, which in turn will jump to the next (if any) alternative's such jump, etc.). The last such jump jumps to the correct final destination. A picture: - _____ _____ - | | | | - | v | v - a | b | c + _____ _____ + | | | | + | v | v + a | b | c
If we are at `b', then fixup_alt_jump right now points to a three-byte space after `a'. We'll put in the jump, set @@ -1731,10 +1731,10 @@ regex_compile (pattern, size, syntax, bufp) break;
- case '{': + case '{': /* If { is a literal. */ if (!(syntax & RE_INTERVALS) - /* If we're at `{' and it's not the open-interval + /* If we're at `{' and it's not the open-interval operator. */ || ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES)) || (p - 2 == pattern && p == pend)) @@ -1773,11 +1773,11 @@ regex_compile (pattern, size, syntax, bufp) { if (syntax & RE_NO_BK_BRACES) goto unfetch_interval; - else + else return REG_BADBR; }
- if (!(syntax & RE_NO_BK_BRACES)) + if (!(syntax & RE_NO_BK_BRACES)) { if (c != '\') return REG_EBRACE;
@@ -1788,7 +1788,7 @@ regex_compile (pattern, size, syntax, bufp) { if (syntax & RE_NO_BK_BRACES) goto unfetch_interval; - else + else return REG_BADBR; }
@@ -1824,7 +1824,7 @@ regex_compile (pattern, size, syntax, bufp) jump_n <succeed_n addr> <jump count> (The upper bound and `jump_n' are omitted if `upper_bound' is 1, though.) */ - else + else { /* If the upper bound is > 1, we need to insert more at the end of the loop. */ unsigned nbytes = 10 + (upper_bound > 1) * 10; @@ -1841,7 +1841,7 @@ regex_compile (pattern, size, syntax, bufp) lower_bound); b += 5;
- /* Code to initialize the lower bound. Insert + /* Code to initialize the lower bound. Insert before the `succeed_n'. The `5' is the last two bytes of this `set_number_at', plus 3 bytes of the following `succeed_n'. */ @@ -1852,7 +1852,7 @@ regex_compile (pattern, size, syntax, bufp) { /* More than one repetition is allowed, so append a backward jump to the `succeed_n' that starts this interval. - + When we've reached this during matching, we'll have matched the interval once, so jump back only `upper_bound - 1' times. */ @@ -1870,7 +1870,7 @@ regex_compile (pattern, size, syntax, bufp) so everything is getting moved up by 5. Conclusion: (b - 2) - (laststart + 3) + 5, i.e., b - laststart. - + We insert this at the beginning of the loop so that if we fail during matching, we'll reinitialize the bounds. */ @@ -1891,7 +1891,7 @@ regex_compile (pattern, size, syntax, bufp) beg_interval = NULL;
/* normal_char and normal_backslash need `c'. */ - PATFETCH (c); + PATFETCH (c);
if (!(syntax & RE_NO_BK_BRACES)) { @@ -1907,7 +1907,7 @@ regex_compile (pattern, size, syntax, bufp) BUF_PUSH (at_dot); break;
- case 's': + case 's': laststart = b; PATFETCH (c); BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]); @@ -1998,11 +1998,11 @@ regex_compile (pattern, size, syntax, bufp) /* Expects the character in `c'. */ normal_char: /* If no exactn currently being built. */ - if (!pending_exact + if (!pending_exact
/* If last exactn not at current position. */ || pending_exact + *pending_exact + 1 != b - + /* We have only one byte following the exactn for the count. */ || *pending_exact == (1 << BYTEWIDTH) - 1
@@ -2017,26 +2017,26 @@ regex_compile (pattern, size, syntax, bufp) : (p[0] == '\' && p[1] == '{')))) { /* Start building a new exactn. */ - + laststart = b;
BUF_PUSH_2 (exactn, 0); pending_exact = b - 1; } - + BUF_PUSH (c); (*pending_exact)++; break; } /* switch (c) */ } /* while p != pend */
- + /* Through the pattern now. */ - + if (fixup_alt_jump) STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
- if (!COMPILE_STACK_EMPTY) + if (!COMPILE_STACK_EMPTY) return REG_EPAREN;
free (compile_stack.stack); @@ -2092,14 +2092,14 @@ insert_op1 (op, loc, arg, end) re_opcode_t op; unsigned char *loc; int arg; - unsigned char *end; + unsigned char *end; { register unsigned char *pfrom = end; register unsigned char *pto = end + 3;
while (pfrom != loc) *--pto = *--pfrom; - + store_op1 (op, loc, arg); }
@@ -2111,14 +2111,14 @@ insert_op2 (op, loc, arg1, arg2, end) re_opcode_t op; unsigned char *loc; int arg1, arg2; - unsigned char *end; + unsigned char *end; { register unsigned char *pfrom = end; register unsigned char *pto = end + 5;
while (pfrom != loc) *--pto = *--pfrom; - + store_op2 (op, loc, arg1, arg2); }
@@ -2134,7 +2134,7 @@ at_begline_loc_p (pattern, p, syntax) { const char *prev = p - 2; boolean prev_prev_backslash = prev > pattern && prev[-1] == '\'; - + return /* After a subexpression? */ (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash)) @@ -2154,7 +2154,7 @@ at_endline_loc_p (p, pend, syntax) const char *next = p; boolean next_backslash = *next == '\'; const char *next_next = p + 1 < pend ? p + 1 : NULL; - + return /* Before a subexpression? */ (syntax & RE_NO_BK_PARENS ? *next == ')' @@ -2165,7 +2165,7 @@ at_endline_loc_p (p, pend, syntax) }
-/* Returns true if REGNUM is in one of COMPILE_STACK's elements and +/* Returns true if REGNUM is in one of COMPILE_STACK's elements and false if it's not. */
static boolean @@ -2175,8 +2175,8 @@ group_in_compile_stack (compile_stack, regnum) { int this_element;
- for (this_element = compile_stack.avail - 1; - this_element >= 0; + for (this_element = compile_stack.avail - 1; + this_element >= 0; this_element--) if (compile_stack.stack[this_element].regnum == regnum) return true; @@ -2190,9 +2190,9 @@ group_in_compile_stack (compile_stack, regnum) starting character is in `P[-2]'. (`P[-1]' is the character `-'.) Then we set the translation of all bits between the starting and ending characters (inclusive) in the compiled pattern B. - + Return an error code. - + We use these short variable names so we can use the same macros as `regex_compile' itself. */
@@ -2207,7 +2207,7 @@ compile_range (p_ptr, pend, translate, syntax, b)
const char *p = *p_ptr; int range_start, range_end; - + if (p == pend) return REG_ERANGE;
@@ -2216,7 +2216,7 @@ compile_range (p_ptr, pend, translate, syntax, b) is set, the range endpoints will be negative if we fetch using a signed char *.
- We also want to fetch the endpoints without translating them; the + We also want to fetch the endpoints without translating them; the appropriate translation is done in the bit-setting loop below. */ range_start = ((unsigned char *) p)[-2]; range_end = ((unsigned char *) p)[0]; @@ -2237,14 +2237,14 @@ compile_range (p_ptr, pend, translate, syntax, b) { SET_LIST_BIT (TRANSLATE (this_char)); } - + return REG_NOERROR; } /* Failure stack declarations and macros; both re_compile_fastmap and re_match_2 use a failure stack. These have to be macros because of REGEX_ALLOCATE. */ - +
/* Number of failure points for which to initially allocate space when matching. If this number is exceeded, we allocate more @@ -2292,8 +2292,8 @@ typedef struct /* Double the size of FAIL_STACK, up to approximately `re_max_failures' items.
Return 1 if succeeds, and 0 if either ran out of memory - allocating space for it or it was already too large. - + allocating space for it or it was already too large. + REGEX_REALLOCATE requires `destination' be declared. */
#define DOUBLE_FAIL_STACK(fail_stack) \ @@ -2310,7 +2310,7 @@ typedef struct 1)))
-/* Push PATTERN_OP on FAIL_STACK. +/* Push PATTERN_OP on FAIL_STACK.
Return 1 if was able to do so and 0 if ran out of memory allocating space to do so. */ @@ -2341,12 +2341,12 @@ typedef struct
/* Push the information about the state we will need - if we ever fail back to it. - + if we ever fail back to it. + Requires variables fail_stack, regstart, regend, reg_info, and num_regs be declared. DOUBLE_FAIL_STACK requires `destination' be declared. - + Does `return FAILURE_CODE' if runs out of memory. */
#define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \ @@ -2454,7 +2454,7 @@ typedef struct LOW_REG, HIGH_REG -- the highest and lowest active registers. REGSTART, REGEND -- arrays of string positions. REG_INFO -- array of information about each subexpression. - + Also assumes the variables `fail_stack' and (if debugging), `bufp', `pend', `string1', `size1', `string2', and `size2'. */
@@ -2522,7 +2522,7 @@ typedef struct
The caller must supply the address of a (1 << BYTEWIDTH)-byte data area as BUFP->fastmap. - + We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in the pattern buffer.
@@ -2539,7 +2539,7 @@ re_compile_fastmap (bufp) #endif /* We don't push any register information onto the failure stack. */ unsigned num_regs = 0; - + register char *fastmap = bufp->fastmap; unsigned char *pattern = bufp->buffer; unsigned long size = bufp->used; @@ -2556,27 +2556,27 @@ re_compile_fastmap (bufp) boolean succeed_n_p = false;
assert (fastmap != NULL && p != NULL); - + INIT_FAIL_STACK (); bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */ bufp->fastmap_accurate = 1; /* It will be when we're done. */ bufp->can_be_null = 0; - + while (p != pend || !FAIL_STACK_EMPTY ()) { if (p == pend) { bufp->can_be_null |= path_can_be_null; - + /* Reset for next path. */ path_can_be_null = true; - + p = fail_stack.stack[--fail_stack.avail]; }
/* We should never be about to go beyond the end of the pattern. */ assert (p < pend); - + #ifdef SWITCH_ENUM_BUG switch ((int) ((re_opcode_t) *p++)) #else @@ -2700,10 +2700,10 @@ re_compile_fastmap (bufp) case jump_past_alt: case dummy_failure_jump: EXTRACT_NUMBER_AND_INCR (j, p); - p += j; + p += j; if (j > 0) continue; - + /* Jump backward implies we just went through the body of a loop and matched nothing. Opcode jumped to should be `on_failure_jump' or `succeed_n'. Just treat it like an @@ -2715,10 +2715,10 @@ re_compile_fastmap (bufp)
p++; EXTRACT_NUMBER_AND_INCR (j, p); - p += j; - + p += j; + /* If what's on the stack is where we are now, pop it. */ - if (!FAIL_STACK_EMPTY () + if (!FAIL_STACK_EMPTY () && fail_stack.stack[fail_stack.avail - 1] == p) fail_stack.avail--;
@@ -2756,7 +2756,7 @@ re_compile_fastmap (bufp)
case succeed_n: /* Get to the number of times to succeed. */ - p += 2; + p += 2;
/* Increment p past the n for when k != 0. */ EXTRACT_NUMBER_AND_INCR (k, p); @@ -2847,7 +2847,7 @@ re_search (bufp, string, size, startpos, range, regs) int size, startpos, range; struct re_registers *regs; { - return re_search_2 (bufp, NULL, 0, string, size, startpos, range, + return re_search_2 (bufp, NULL, 0, string, size, startpos, range, regs, size); }
@@ -2855,17 +2855,17 @@ re_search (bufp, string, size, startpos, range, regs) /* Using the compiled pattern in BUFP->buffer, first tries to match the virtual concatenation of STRING1 and STRING2, starting first at index STARTPOS, then at STARTPOS + 1, and so on. - + STRING1 and STRING2 have length SIZE1 and SIZE2, respectively. - + RANGE is how far to scan while trying to match. RANGE = 0 means try only at STARTPOS; in general, the last start tried is STARTPOS + RANGE. - + In REGS, return the indices of the virtual concatenation of STRING1 and STRING2 that matched the entire BUFP->buffer and its contained subexpressions. - + Do not consider matching one past the index STOP in the virtual concatenation of STRING1 and STRING2.
@@ -2892,7 +2892,7 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop) /* Check for out-of-range STARTPOS. */ if (startpos < 0 || startpos > total_size) return -1; - + /* Fix up RANGE if it might eventually take us outside the virtual concatenation of STRING1 and STRING2. */ if (endpos < -1) @@ -2914,10 +2914,10 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop) if (fastmap && !bufp->fastmap_accurate) if (re_compile_fastmap (bufp) == -2) return -2; - + /* Loop through the string, looking for a place to start matching. */ for (;;) - { + { /* If a fastmap is supplied, skip quickly over characters that cannot be the start of a match. If the pattern can match the null string, however, we don't need to skip characters; we want @@ -2934,7 +2934,7 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop) lim = range - (size1 - startpos);
d = (startpos >= size1 ? string2 - size1 : string1) + startpos; - + /* Written out as an if-else to avoid testing `translate' inside the loop. */ if (translate) @@ -2951,7 +2951,7 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop) else /* Searching backwards. */ { register char c = (size1 == 0 || startpos >= size1 - ? string2[startpos - size1] + ? string2[startpos - size1] : string1[startpos]);
if (!fastmap[(unsigned char) TRANSLATE (c)]) @@ -2968,21 +2968,21 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop) startpos, regs, stop); if (val >= 0) return startpos; - + if (val == -2) return -2;
advance: - if (!range) + if (!range) break; - else if (range > 0) + else if (range > 0) { - range--; + range--; startpos++; } else { - range++; + range++; startpos--; } } @@ -3001,8 +3001,8 @@ static boolean alt_match_null_string_p (), onto the failure stack. Other register information, such as the starting and ending positions (which are addresses), and the list of inner groups (which is a bits list) are maintained in separate - variables. - + variables. + We are making a (strictly speaking) nonportable assumption here: that the compiler will pack our bit fields into something that fits into the type of `word', i.e., is something that fits into one item on the @@ -3076,7 +3076,7 @@ typedef union /* Test if at very beginning or at very end of the virtual concatenation of `string1' and `string2'. If only one string, it's `string2'. */ #define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2) -#define AT_STRINGS_END(d) ((d) == end2) +#define AT_STRINGS_END(d) ((d) == end2)
/* Test if D points to a character which is word-constituent. We have @@ -3139,7 +3139,7 @@ re_match (bufp, string, size, pos, regs) int size, pos; struct re_registers *regs; { - return re_match_2 (bufp, NULL, 0, string, size, pos, regs, size); + return re_match_2 (bufp, NULL, 0, string, size, pos, regs, size); } #endif /* not emacs */
@@ -3148,7 +3148,7 @@ re_match (bufp, string, size, pos, regs) the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1 and SIZE2, respectively). We start matching at POS, and stop matching at STOP. - + If REGS is non-null and the `no_sub' field of BUFP is nonzero, we store offsets for the substring each group matched in REGS. See the documentation for exactly how many groups we fill. @@ -3179,7 +3179,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Where we are in the data, and the end of the current string. */ const char *d, *dend; - + /* Where we are in the pattern, and the end of the pattern. */ unsigned char *p = bufp->buffer; register unsigned char *pend = p + bufp->used; @@ -3206,7 +3206,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) return, for use in backreferences. The number here includes an element for register zero. */ unsigned num_regs = bufp->re_nsub + 1; - + /* The currently active registers. */ unsigned lowest_active_reg = NO_LOWEST_ACTIVE_REG; unsigned highest_active_reg = NO_HIGHEST_ACTIVE_REG; @@ -3233,15 +3233,15 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) matched any of the pattern so far this time through the reg_num-th subexpression. These two fields get reset each time through any loop their register is in. */ - register_info_type *reg_info; + register_info_type *reg_info;
/* The following record the register info as found in the above - variables when we find a match better than any we've seen before. + variables when we find a match better than any we've seen before. This happens as we backtrack through the failure points, which in turn happens only if we have not yet matched the entire string. */ unsigned best_regs_set = false; const char **best_regstart, **best_regend; - + /* Logically, this is `best_regend[0]'. But we don't want to have to allocate space for that if we're not allocating space for anything else (see below). Also, we never need info about register 0 for @@ -3258,13 +3258,13 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
#ifdef DEBUG /* Counts the total number of registers pushed. */ - unsigned num_regs_pushed = 0; + unsigned num_regs_pushed = 0; #endif
DEBUG_PRINT1 ("\n\nEntering re_match_2.\n"); - + INIT_FAIL_STACK (); - + /* Do not bother to initialize all the register variables if there are no groups in the pattern, as it takes a fair amount of time. If there are groups, we include space for register 0 (the whole @@ -3282,8 +3282,8 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) reg_dummy = REGEX_TALLOC (num_regs, const char *); reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type);
- if (!(regstart && regend && old_regstart && old_regend && reg_info - && best_regstart && best_regend && reg_dummy && reg_info_dummy)) + if (!(regstart && regend && old_regstart && old_regend && reg_info + && best_regstart && best_regend && reg_dummy && reg_info_dummy)) { FREE_VARIABLES (); return -2; @@ -3306,21 +3306,21 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) FREE_VARIABLES (); return -1; } - + /* Initialize subexpression text positions to -1 to mark ones that no start_memory/stop_memory has been seen for. Also initialize the register information struct. */ for (mcnt = 1; mcnt < num_regs; mcnt++) { - regstart[mcnt] = regend[mcnt] + regstart[mcnt] = regend[mcnt] = old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE; - + REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE; IS_ACTIVE (reg_info[mcnt]) = 0; MATCHED_SOMETHING (reg_info[mcnt]) = 0; EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0; } - + /* We move `string1' into `string2' if the latter's empty -- but not if `string1' is null. */ if (size2 == 0 && string1 != NULL) @@ -3345,7 +3345,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) end_match_2 = string2 + stop - size1; }
- /* `p' scans through the pattern as `d' scans through the data. + /* `p' scans through the pattern as `d' scans through the data. `dend' is the end of the input string that `d' points within. `d' is advanced into the following input string whenever necessary, but this happens before fetching; therefore, at the beginning of the @@ -3367,7 +3367,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) DEBUG_PRINT1 ("The string to match is: `"); DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2); DEBUG_PRINT1 ("'\n"); - + /* This loops over pattern commands. It exits by returning from the function if the match is complete, or it drops through if the match fails at this starting point in the input data. */ @@ -3378,16 +3378,16 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) if (p == pend) { /* End of pattern means we might have succeeded. */ DEBUG_PRINT1 ("end of pattern ... "); - + /* If we haven't matched the entire string, and we want the longest match, try backtracking. */ if (d != end_match_2) { DEBUG_PRINT1 ("backtracking.\n"); - + if (!FAIL_STACK_EMPTY ()) { /* More failure points to try. */ - boolean same_str_p = (FIRST_STRING_P (match_end) + boolean same_str_p = (FIRST_STRING_P (match_end) == MATCHING_IN_FIRST_STRING);
/* If exceeds best match so far, save it. */ @@ -3397,20 +3397,20 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) { best_regs_set = true; match_end = d; - + DEBUG_PRINT1 ("\nSAVING match as best so far.\n"); - + for (mcnt = 1; mcnt < num_regs; mcnt++) { best_regstart[mcnt] = regstart[mcnt]; best_regend[mcnt] = regend[mcnt]; } } - goto fail; + goto fail; }
/* If no failure points, don't restore garbage. */ - else if (best_regs_set) + else if (best_regs_set) { restore_best_regs: /* Restore best match. It may happen that `dend == @@ -3419,7 +3419,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) strings `x-' and `y-z-', if the two strings are not consecutive in memory. */ DEBUG_PRINT1 ("Restoring best registers.\n"); - + d = match_end; dend = ((d >= string1 && d <= end1) ? end_match_1 : end_match_2); @@ -3474,7 +3474,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) regs->end[0] = (MATCHING_IN_FIRST_STRING ? d - string1 : d - string2 + size1); } - + /* Go through the first `min (num_regs, regs->num_regs)' registers, since that is all we initialized. */ for (mcnt = 1; mcnt < MIN (num_regs, regs->num_regs); mcnt++) @@ -3487,7 +3487,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) regs->end[mcnt] = POINTER_TO_OFFSET (regend[mcnt]); } } - + /* If the regs structure we return has more elements than were in the pattern, set the extra elements to -1. If we (re)allocated the registers, this is the case, @@ -3503,8 +3503,8 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) nfailure_points_pushed - nfailure_points_popped); DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed);
- mcnt = d - pos - (MATCHING_IN_FIRST_STRING - ? string1 + mcnt = d - pos - (MATCHING_IN_FIRST_STRING + ? string1 : string2 - size1);
DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt); @@ -3594,7 +3594,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) p += 1 + *p;
if (!not) goto fail; - + SET_REGS_MATCHED (); d++; break; @@ -3611,9 +3611,9 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Find out if this group can match the empty string. */ p1 = p; /* To send to group_match_null_string_p. */ - + if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE) - REG_MATCH_NULL_STRING_P (reg_info[*p]) + REG_MATCH_NULL_STRING_P (reg_info[*p]) = group_match_null_string_p (&p1, pend, reg_info);
/* Save the position in the string where we were the last time @@ -3624,7 +3624,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p]) ? REG_UNSET (regstart[*p]) ? d : regstart[*p] : regstart[*p]; - DEBUG_PRINT2 (" old_regstart: %d\n", + DEBUG_PRINT2 (" old_regstart: %d\n", POINTER_TO_OFFSET (old_regstart[*p]));
regstart[*p] = d; @@ -3632,10 +3632,10 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
IS_ACTIVE (reg_info[*p]) = 1; MATCHED_SOMETHING (reg_info[*p]) = 0; - + /* This is the new highest active register. */ highest_active_reg = *p; - + /* If nothing was active before, this is the new lowest active register. */ if (lowest_active_reg == NO_LOWEST_ACTIVE_REG) @@ -3651,7 +3651,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) number, and the number of inner groups. */ case stop_memory: DEBUG_PRINT3 ("EXECUTING stop_memory %d (%d):\n", *p, p[1]); - + /* We need to save the string position the last time we were at this close-group operator in case the group is operated upon by a repetition operator, e.g., with `((a*)*(b*)*)*' @@ -3660,7 +3660,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p]) ? REG_UNSET (regend[*p]) ? d : regend[*p] : regend[*p]; - DEBUG_PRINT2 (" old_regend: %d\n", + DEBUG_PRINT2 (" old_regend: %d\n", POINTER_TO_OFFSET (old_regend[*p]));
regend[*p] = d; @@ -3668,7 +3668,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* This register isn't active anymore. */ IS_ACTIVE (reg_info[*p]) = 0; - + /* If this was the only register active, nothing is active anymore. */ if (lowest_active_reg == highest_active_reg) @@ -3684,7 +3684,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) unsigned char r = *p - 1; while (r > 0 && !IS_ACTIVE (reg_info[r])) r--; - + /* If we end up at register zero, that means that we saved the registers as the result of an `on_failure_jump', not a `start_memory', and we jumped to past the innermost @@ -3700,7 +3700,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) else highest_active_reg = r; } - + /* If just failed to match something this time around with a group that's operated on by a repetition operator, try to force exit from the ``loop'', and restore the register @@ -3708,10 +3708,10 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) last match. */ if ((!MATCHED_SOMETHING (reg_info[*p]) || (re_opcode_t) p[-3] == start_memory) - && (p + 2) < pend) + && (p + 2) < pend) { boolean is_a_jump_n = false; - + p1 = p + 2; mcnt = 0; switch ((re_opcode_t) *p1++) @@ -3726,12 +3726,12 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) if (is_a_jump_n) p1 += 2; break; - + default: /* do nothing */ ; } p1 += mcnt; - + /* If the next operation is a jump backwards in the pattern to an on_failure_jump right before the start_memory corresponding to this stop_memory, exit from the loop @@ -3745,17 +3745,17 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) failed match, e.g., with `(a*)*b' against `ab' for regstart[1], and, e.g., with `((a*)*(b*)*)*' against `aba' for regend[3]. - + Also restore the registers for inner groups for, e.g., `((a*)(b*))*' against `aba' (register 3 would otherwise get trashed). */ - + if (EVER_MATCHED_SOMETHING (reg_info[*p])) { - unsigned r; - + unsigned r; + EVER_MATCHED_SOMETHING (reg_info[*p]) = 0; - + /* Restore this and inner groups' (if any) registers. */ for (r = *p; r < *p + *(p + 1); r++) { @@ -3764,7 +3764,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) /* xx why this test? */ if ((int) old_regend[r] >= (int) regstart[r]) regend[r] = old_regend[r]; - } + } } p1++; EXTRACT_NUMBER_AND_INCR (mcnt, p1); @@ -3773,7 +3773,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) goto fail; } } - + /* Move past the register number and the inner group count. */ p += 2; break; @@ -3790,16 +3790,16 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) /* Can't back reference a group which we've never matched. */ if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno])) goto fail; - + /* Where in input to try to start matching. */ d2 = regstart[regno]; - + /* Where to stop matching; if both the place to start and the place to stop matching are in the same string, then set to the place to stop, otherwise, for now have to use the end of the first string. */
- dend2 = ((FIRST_STRING_P (regstart[regno]) + dend2 = ((FIRST_STRING_P (regstart[regno]) == FIRST_STRING_P (regend[regno])) ? regend[regno] : end_match_1); for (;;) @@ -3823,16 +3823,16 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* How many characters left in this segment to match. */ mcnt = dend - d; - + /* Want how many consecutive characters we can match in one shot, so, if necessary, adjust the count. */ if (mcnt > dend2 - d2) mcnt = dend2 - d2; - + /* Compare that many; failure if mismatch, else move past them. */ - if (translate - ? bcmp_translate (d, d2, mcnt, translate) + if (translate + ? bcmp_translate (d, d2, mcnt, translate) : bcmp (d, d2, mcnt)) goto fail; d += mcnt, d2 += mcnt; @@ -3846,7 +3846,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) `newline_anchor' is set, after newlines. */ case begline: DEBUG_PRINT1 ("EXECUTING begline.\n"); - + if (AT_STRINGS_BEG (d)) { if (!bufp->not_bol) break; @@ -3867,7 +3867,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) { if (!bufp->not_eol) break; } - + /* We have to ``prefetch'' the next character. */ else if ((d == end1 ? *string2 : *d) == '\n' && bufp->newline_anchor) @@ -3901,7 +3901,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) then the . fails against the \n. But the next thing we want to do is match the \n against the \n; if we restored the string value, we would be back at the foo. - + Because this is used only in specific cases, we don't need to check all the things that `on_failure_jump' does, to make sure the right things get saved on the stack. Hence we don't @@ -3911,7 +3911,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) case; that seems worse than this. */ case on_failure_keep_string_jump: DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump"); - + EXTRACT_NUMBER_AND_INCR (mcnt, p); DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt);
@@ -3920,7 +3920,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Uses of on_failure_jump: - + Each alternative starts with an on_failure_jump that points to the beginning of the next alternative. Each alternative except the last ends with a jump that in effect jumps past @@ -3986,7 +3986,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) would have to backtrack because of (as in, e.g., `a*a') then we can change to pop_failure_jump, because we'll never have to backtrack. - + This is not true in the case of alternatives: in `(a|ab)*' we do need to backtrack to the `ab' alternative (e.g., if the string was `ab'). But instead of trying to @@ -4018,7 +4018,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) p1 = p + mcnt;
/* p1[0] ... p1[2] are the `on_failure_jump' corresponding - to the `maybe_finalize_jump' of this case. Examine what + to the `maybe_finalize_jump' of this case. Examine what follows. */ if ((re_opcode_t) p1[3] == exactn && p1[5] != c) { @@ -4026,12 +4026,12 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n", c, p1[5]); } - + else if ((re_opcode_t) p1[3] == charset || (re_opcode_t) p1[3] == charset_not) { int not = (re_opcode_t) p1[3] == charset_not; - + if (c < (unsigned char) (p1[4] * BYTEWIDTH) && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH))) not = !not; @@ -4080,7 +4080,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) } /* Note fall through. */
- + /* Unconditionally jump (without popping any failure points). */ case jump: unconditional_jump: @@ -4090,7 +4090,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) DEBUG_PRINT2 ("(to 0x%x).\n", p); break;
- + /* We need this opcode so we can detect where alternatives end in `group_match_null_string_p' et al. */ case jump_past_alt: @@ -4125,7 +4125,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Have to succeed matching what follows at least n times. After that, handle like `on_failure_jump'. */ - case succeed_n: + case succeed_n: EXTRACT_NUMBER (mcnt, p + 2); DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt);
@@ -4146,8 +4146,8 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) goto on_failure; } break; - - case jump_n: + + case jump_n: EXTRACT_NUMBER (mcnt, p + 2); DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt);
@@ -4156,13 +4156,13 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) { mcnt--; STORE_NUMBER (p + 2, mcnt); - goto unconditional_jump; + goto unconditional_jump; } /* If don't have to jump any more, skip over the rest of command. */ - else - p += 4; + else + p += 4; break; - + case set_number_at: { DEBUG_PRINT1 ("EXECUTING set_number_at.\n"); @@ -4207,13 +4207,13 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) if (PTR_CHAR_POS ((unsigned char *) d) >= point) goto fail; break; - + case at_dot: DEBUG_PRINT1 ("EXECUTING at_dot.\n"); if (PTR_CHAR_POS ((unsigned char *) d) != point) goto fail; break; - + case after_dot: DEBUG_PRINT1 ("EXECUTING after_dot.\n"); if (PTR_CHAR_POS ((unsigned char *) d) <= point) @@ -4266,7 +4266,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) SET_REGS_MATCHED (); d++; break; - + case notwordchar: DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n"); PREFETCH (); @@ -4276,7 +4276,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) d++; break; #endif /* not emacs */ - + default: abort (); } @@ -4301,7 +4301,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) if (p < pend) { boolean is_a_jump_n = false; - + /* If failed to a backwards jump that's part of a repetition loop, need to pop this failure point and use the next one. */ switch ((re_opcode_t) *p) @@ -4313,7 +4313,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) case jump: p1 = p + 1; EXTRACT_NUMBER_AND_INCR (mcnt, p1); - p1 += mcnt; + p1 += mcnt;
if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n) || (!is_a_jump_n @@ -4344,10 +4344,10 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* We are passed P pointing to a register number after a start_memory. - + Return true if the pattern up to the corresponding stop_memory can match the empty string, and false otherwise. - + If we find the matching stop_memory, sets P to point to one past its number. Otherwise, sets P to an undefined byte less than or equal to END.
@@ -4361,20 +4361,20 @@ group_match_null_string_p (p, end, reg_info) int mcnt; /* Point to after the args to the start_memory. */ unsigned char *p1 = *p + 2; - + while (p1 < end) { /* Skip over opcodes that can match nothing, and return true or false, as appropriate, when we get to one that can't, or to the matching stop_memory. */ - + switch ((re_opcode_t) *p1) { /* Could be either a loop or a series of alternatives. */ case on_failure_jump: p1++; EXTRACT_NUMBER_AND_INCR (mcnt, p1); - + /* If the next operation is not a jump backwards in the pattern. */
@@ -4388,7 +4388,7 @@ group_match_null_string_p (p, end, reg_info)
/on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6 /on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3 - /exactn/1/c + /exactn/1/c
So, we have to first go through the first (n-1) alternatives and then deal with the last one separately. */ @@ -4404,19 +4404,19 @@ group_match_null_string_p (p, end, reg_info) is, including the ending `jump_past_alt' and its number. */
- if (!alt_match_null_string_p (p1, p1 + mcnt - 3, + if (!alt_match_null_string_p (p1, p1 + mcnt - 3, reg_info)) return false;
/* Move to right after this alternative, including the jump_past_alt. */ - p1 += mcnt; + p1 += mcnt;
/* Break if it's the beginning of an n-th alternative that doesn't begin with an on_failure_jump. */ if ((re_opcode_t) *p1 != on_failure_jump) break; - + /* Still have to check that it's not an n-th alternative that starts with an on_failure_jump. */ p1++; @@ -4441,14 +4441,14 @@ group_match_null_string_p (p, end, reg_info) } /* if mcnt > 0 */ break;
- + case stop_memory: assert (p1[1] == **p); *p = p1 + 2; return true;
- - default: + + default: if (!common_op_match_null_string_p (&p1, end, reg_info)) return false; } @@ -4461,7 +4461,7 @@ group_match_null_string_p (p, end, reg_info) /* Similar to group_match_null_string_p, but doesn't deal with alternatives: It expects P to be the first byte of a single alternative and END one byte past the last. The alternative can contain groups. */ - + static boolean alt_match_null_string_p (p, end, reg_info) unsigned char *p, *end; @@ -4469,12 +4469,12 @@ alt_match_null_string_p (p, end, reg_info) { int mcnt; unsigned char *p1 = p; - + while (p1 < end) { - /* Skip over opcodes that can match nothing, and break when we get + /* Skip over opcodes that can match nothing, and break when we get to one that can't. */ - + switch ((re_opcode_t) *p1) { /* It's a loop. */ @@ -4483,8 +4483,8 @@ alt_match_null_string_p (p, end, reg_info) EXTRACT_NUMBER_AND_INCR (mcnt, p1); p1 += mcnt; break; - - default: + + default: if (!common_op_match_null_string_p (&p1, end, reg_info)) return false; } @@ -4495,8 +4495,8 @@ alt_match_null_string_p (p, end, reg_info)
/* Deals with the ops common to group_match_null_string_p and - alt_match_null_string_p. - + alt_match_null_string_p. + Sets P to one after the op and its arguments, if any. */
static boolean @@ -4531,7 +4531,7 @@ common_op_match_null_string_p (p, end, reg_info) reg_no = *p1; assert (reg_no > 0 && reg_no <= MAX_REGNUM); ret = group_match_null_string_p (&p1, end, reg_info); - + /* Have to set this here in case we're checking a group which contains a group and a back reference to it. */
@@ -4541,7 +4541,7 @@ common_op_match_null_string_p (p, end, reg_info) if (!ret) return false; break; - + /* If this is an optimized succeed_n for zero times, make the jump. */ case jump: EXTRACT_NUMBER_AND_INCR (mcnt, p1); @@ -4553,7 +4553,7 @@ common_op_match_null_string_p (p, end, reg_info)
case succeed_n: /* Get to the number of times to succeed. */ - p1 += 2; + p1 += 2; EXTRACT_NUMBER_AND_INCR (mcnt, p1);
if (mcnt == 0) @@ -4566,7 +4566,7 @@ common_op_match_null_string_p (p, end, reg_info) return false; break;
- case duplicate: + case duplicate: if (!REG_MATCH_NULL_STRING_P (reg_info[*p1])) return false; break; @@ -4586,7 +4586,7 @@ common_op_match_null_string_p (p, end, reg_info)
/* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN bytes; nonzero otherwise. */ - + static int bcmp_translate (s1, s2, len, translate) unsigned char *s1, *s2; @@ -4607,10 +4607,10 @@ bcmp_translate (s1, s2, len, translate) /* re_compile_pattern is the GNU regular expression compiler: it compiles PATTERN (of length SIZE) and puts the result in BUFP. Returns 0 if the pattern was valid, otherwise an error string. - + Assumes the `allocated' (and perhaps `buffer') and `translate' fields are set in BUFP on entry. - + We call regex_compile to do the actual compilation. */
const char * @@ -4620,23 +4620,23 @@ re_compile_pattern (pattern, length, bufp) struct re_pattern_buffer *bufp; { reg_errcode_t ret; - + /* GNU code is written to assume at least RE_NREGS registers will be set (and at least one extra will be -1). */ bufp->regs_allocated = REGS_UNALLOCATED; - + /* And GNU code determines whether or not to get register information by passing null for the REGS argument to re_match, etc., not by setting no_sub. */ bufp->no_sub = 0; - + /* Match anchors at newline. */ bufp->newline_anchor = 1; - + ret = regex_compile (pattern, length, re_syntax_options, bufp);
return re_error_msg[(int) ret]; -} +} /* Entry points compatible with 4.2 BSD regex library. We don't define them if this is an Emacs or POSIX compilation. */ @@ -4651,7 +4651,7 @@ re_comp (s) const char *s; { reg_errcode_t ret; - + if (!s) { if (!re_comp_buf.buffer) @@ -4678,7 +4678,7 @@ re_comp (s) re_comp_buf.newline_anchor = 1;
ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf); - + /* Yes, we're discarding `const' here. */ return (char *) re_error_msg[(int) ret]; } @@ -4735,7 +4735,7 @@ re_exec (s) int regcomp (preg, pattern, cflags) regex_t *preg; - const char *pattern; + const char *pattern; int cflags; { reg_errcode_t ret; @@ -4746,17 +4746,17 @@ regcomp (preg, pattern, cflags) /* regex_compile will allocate the space for the compiled pattern. */ preg->buffer = 0; preg->allocated = 0; - + /* Don't bother to use a fastmap when searching. This simplifies the REG_NEWLINE case: if we used a fastmap, we'd have to put all the characters after newlines into the fastmap. This way, we just try every character. */ preg->fastmap = 0; - + if (cflags & REG_ICASE) { unsigned i; - + preg->translate = (char *) malloc (CHAR_SET_SIZE); if (preg->translate == NULL) return (int) REG_ESPACE; @@ -4781,38 +4781,38 @@ regcomp (preg, pattern, cflags)
preg->no_sub = !!(cflags & REG_NOSUB);
- /* POSIX says a null character in the pattern terminates it, so we + /* POSIX says a null character in the pattern terminates it, so we can use strlen here in compiling the pattern. */ ret = regex_compile (pattern, strlen (pattern), syntax, preg); - + /* POSIX doesn't distinguish between an unmatched open-group and an unmatched close-group: both are REG_EPAREN. */ if (ret == REG_ERPAREN) ret = REG_EPAREN; - + return (int) ret; }
/* regexec searches for a given pattern, specified by PREG, in the string STRING. - + If NMATCH is zero or REG_NOSUB was set in the cflags argument to `regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at least NMATCH elements, and we set them to the offsets of the corresponding matched substrings. - + EFLAGS specifies `execution flags' which affect matching: if REG_NOTBOL is set, then ^ does not match at the beginning of the string; if REG_NOTEOL is set, then $ does not match at the end. - + We return 0 if we find a match and REG_NOMATCH if not. */
int regexec (preg, string, nmatch, pmatch, eflags) const regex_t *preg; - const char *string; - size_t nmatch; - regmatch_t pmatch[]; + const char *string; + size_t nmatch; + regmatch_t pmatch[]; int eflags; { int ret; @@ -4822,15 +4822,15 @@ regexec (preg, string, nmatch, pmatch, eflags) boolean want_reg_info = !preg->no_sub && nmatch > 0;
private_preg = *preg; - + private_preg.not_bol = !!(eflags & REG_NOTBOL); private_preg.not_eol = !!(eflags & REG_NOTEOL); - + /* The user has told us exactly how many registers to return information about, via `nmatch'. We have to pass that on to the matching routines. */ private_preg.regs_allocated = REGS_FIXED; - + if (want_reg_info) { regs.num_regs = nmatch; @@ -4844,7 +4844,7 @@ regexec (preg, string, nmatch, pmatch, eflags) ret = re_search (&private_preg, string, len, /* start: */ 0, /* range: */ len, want_reg_info ? ®s : (struct re_registers *) 0); - + /* Copy the register information to the POSIX structure. */ if (want_reg_info) { @@ -4884,7 +4884,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
if (errcode < 0 || errcode >= (sizeof (re_error_msg) / sizeof (re_error_msg[0]))) - /* Only error codes returned by the rest of the code should be passed + /* Only error codes returned by the rest of the code should be passed to this routine. If we are given anything else, or if other regex code generates an invalid error code, then the program has a bug. Dump core so we can fix it. */ @@ -4898,7 +4898,7 @@ regerror (errcode, preg, errbuf, errbuf_size) msg = "Success";
msg_size = strlen (msg) + 1; /* Includes the null. */ - + if (errbuf_size != 0) { if (msg_size > errbuf_size) @@ -4923,7 +4923,7 @@ regfree (preg) if (preg->buffer != NULL) free (preg->buffer); preg->buffer = NULL; - + preg->allocated = 0; preg->used = 0;
diff --git a/util/kconfig/regex.h b/util/kconfig/regex.h index 408dd21..9124397 100644 --- a/util/kconfig/regex.h +++ b/util/kconfig/regex.h @@ -42,7 +42,7 @@ typedef unsigned reg_syntax_t; #define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
/* If this bit is not set, then + and ? are operators, and + and ? are - literals. + literals. If set, then + and ? are operators and + and ? are literals. */ #define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
@@ -58,7 +58,7 @@ typedef unsigned reg_syntax_t; ^ is an anchor if it is at the beginning of a regular expression or after an open-group or an alternation operator; $ is an anchor if it is at the end of a regular expression, or - before a close-group or an alternation operator. + before a close-group or an alternation operator.
This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because POSIX draft 11.2 says that * etc. in leading positions is undefined. @@ -69,7 +69,7 @@ typedef unsigned reg_syntax_t; /* If this bit is set, then special characters are always special regardless of where they are in the pattern. If this bit is not set, then special characters are special only in - some contexts; otherwise they are ordinary. Specifically, + some contexts; otherwise they are ordinary. Specifically, * + ? and intervals are only special when not after the beginning, open-group, or alternation operator. */ #define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1) @@ -91,7 +91,7 @@ typedef unsigned reg_syntax_t; #define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
/* If this bit is set, either {...} or {...} defines an - interval, depending on RE_NO_BK_BRACES. + interval, depending on RE_NO_BK_BRACES. If not set, {, }, {, and } are literals. */ #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
@@ -116,7 +116,7 @@ typedef unsigned reg_syntax_t; If not set, then <digit> is a back-reference. */ #define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
-/* If this bit is set, then | is an alternation operator, and | is literal. +/* If this bit is set, then | is an alternation operator, and | is literal. If not set, then | is an alternation operator, and | is literal. */ #define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
@@ -138,7 +138,7 @@ extern reg_syntax_t re_syntax_options; /* Define combinations of the above bits for the standard possibilities. (The [[[ comments delimit what gets put into the Texinfo file, so - don't delete them!) */ + don't delete them!) */ /* [[[begin syntaxes]]] */ #define RE_SYNTAX_EMACS 0
@@ -205,7 +205,7 @@ extern reg_syntax_t re_syntax_options; #ifdef RE_DUP_MAX #undef RE_DUP_MAX #endif -#define RE_DUP_MAX ((1 << 15) - 1) +#define RE_DUP_MAX ((1 << 15) - 1)
/* POSIX `cflags' bits (i.e., information for `regcomp'). */ @@ -217,7 +217,7 @@ extern reg_syntax_t re_syntax_options; /* If this bit is set, then ignore case when matching. If not set, then case is significant. */ #define REG_ICASE (REG_EXTENDED << 1) - + /* If this bit is set, then anchors do not match at newline characters in the string. If not set, then anchors do match at newlines. */ @@ -256,7 +256,7 @@ typedef enum REG_EESCAPE, /* Trailing backslash. */ REG_ESUBREG, /* Invalid back reference. */ REG_EBRACK, /* Unmatched left bracket. */ - REG_EPAREN, /* Parenthesis imbalance. */ + REG_EPAREN, /* Parenthesis imbalance. */ REG_EBRACE, /* Unmatched {. */ REG_BADBR, /* Invalid contents of {}. */ REG_ERANGE, /* Invalid range end. */ @@ -287,7 +287,7 @@ struct re_pattern_buffer unsigned long allocated;
/* Number of bytes actually used in `buffer'. */ - unsigned long used; + unsigned long used;
/* Syntax setting with which the pattern was compiled. */ reg_syntax_t syntax; @@ -331,7 +331,7 @@ struct re_pattern_buffer unsigned no_sub : 1;
/* If set, a beginning-of-line anchor doesn't match at the - beginning of the string. */ + beginning of the string. */ unsigned not_bol : 1;
/* Similarly for an end-of-line anchor. */ @@ -443,7 +443,7 @@ extern int re_match
/* Relates to `re_match' as `re_search_2' relates to `re_search'. */ -extern int re_match_2 +extern int re_match_2 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, int length1, const char *string2, int length2, int start, struct re_registers *regs, int stop)); diff --git a/util/kconfig/zconf.tab.c_shipped b/util/kconfig/zconf.tab.c_shipped index aba0a44..6f3700c 100644 --- a/util/kconfig/zconf.tab.c_shipped +++ b/util/kconfig/zconf.tab.c_shipped @@ -1393,7 +1393,7 @@ yyparse () #endif #endif { - + int yystate; int yyn; int yyresult; diff --git a/x86/Makefile.inc b/x86/Makefile.inc index 0d6fc64..3a97ca4 100644 --- a/x86/Makefile.inc +++ b/x86/Makefile.inc @@ -1,6 +1,6 @@ # -# Copyright (C) 2008 by coresystems GmbH -# +# Copyright (C) 2008 by coresystems GmbH +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or diff --git a/x86/artecboot.c b/x86/artecboot.c index 697a05b..cd224a0 100644 --- a/x86/artecboot.c +++ b/x86/artecboot.c @@ -1,6 +1,6 @@ /******************************************************************************* * - * FILO Artecboot loader, enables multiboot through custom header + * FILO Artecboot loader, enables multiboot through custom header * * Copyright 2006 Andrei Birjukov andrei.birjukov@artecdesign.ee and * Artec Design LLC http://www.artecdesign.ee @@ -39,7 +39,7 @@ int artecboot_load(const char *file, const char *cmdline) printf("Starting the Artecboot loader...\n"); // clear the boot header memset(&bootHdr, 0, sizeof(bootHdr)); - + // try opening the boot parameter file if (!file_open(file)) { @@ -48,7 +48,7 @@ int artecboot_load(const char *file, const char *cmdline) }
file_seek(0); // seek to the beginning of the parameter file - + // now read out the boot header if(file_read(&bootHdr, sizeof(ARTECBOOT_HEADER)) != sizeof(ARTECBOOT_HEADER)) { @@ -56,7 +56,7 @@ int artecboot_load(const char *file, const char *cmdline) file_close(); return LOADER_NOT_SUPPORT; } - + // check whether the parameter data is valid at all if(bootHdr.magicHeader != ARTECBOOT_HEADER_MAGIC) { @@ -72,7 +72,7 @@ int artecboot_load(const char *file, const char *cmdline) file_close(); return LOADER_NOT_SUPPORT; } - + // shall we replace the command line? if(bootHdr.bitFlags & FLAG_CMDLINE) { @@ -89,9 +89,9 @@ int artecboot_load(const char *file, const char *cmdline) break; } } - else if(cmdline) + else if(cmdline) strncpy(bootHdr.cmdLine, cmdline, sizeof(bootHdr.cmdLine)); - + // proceed basing on the specified OS type switch(bootHdr.osType) { @@ -102,58 +102,58 @@ int artecboot_load(const char *file, const char *cmdline) if(bootHdr.bitFlags & FLAG_FILESYSTEM) { // we are using a real filesystem, so format the initrd file as usually - sprintf(initrdParam, " initrd=%s", bootHdr.initrdFile); + sprintf(initrdParam, " initrd=%s", bootHdr.initrdFile); } else { // we are using a 'fake' filesystem, so use the image offset sprintf(initrdParam, " initrd=%s@0x%x,0x%x", dev_name, bootHdr.initrdStart, bootHdr.initrdSize); - } + }
- debug("adding initrd parameter: %s\n", initrdParam); + debug("adding initrd parameter: %s\n", initrdParam); strncat(bootHdr.cmdLine, initrdParam, sizeof(bootHdr.cmdLine)); } - + printf("Starting Linux loader...\n");
- // if using a real filesystem, load the kernel image from a specified file + // if using a real filesystem, load the kernel image from a specified file if(bootHdr.bitFlags & FLAG_FILESYSTEM) linux_load(bootHdr.kernelFile, bootHdr.cmdLine); // if using a 'fake' filesystem, consider reading from the same image else { - part_start = bootHdr.kernelStart >> DEV_SECTOR_BITS; + part_start = bootHdr.kernelStart >> DEV_SECTOR_BITS; part_length = ((bootHdr.kernelSize-1) >> DEV_SECTOR_BITS) + 1; filemax = bootHdr.kernelSize; using_devsize = 0; linux_load(file, bootHdr.cmdLine); } - + break; - + case OS_WINCE:
printf("Starting Windows CE loader...\n"); - // if using a real filesystem, load the kernel image from a specified file + // if using a real filesystem, load the kernel image from a specified file if(bootHdr.bitFlags & FLAG_FILESYSTEM) wince_load(bootHdr.kernelFile, bootHdr.cmdLine); // if using a 'fake' filesystem, consider reading from the same image else { - part_start = bootHdr.kernelStart >> DEV_SECTOR_BITS; + part_start = bootHdr.kernelStart >> DEV_SECTOR_BITS; part_length = ((bootHdr.kernelSize-1) >> DEV_SECTOR_BITS) + 1; - filemax = bootHdr.kernelSize; + filemax = bootHdr.kernelSize; wince_load(file, bootHdr.cmdLine); }
- break; - + break; + default: printf("Boot error: unknown OS type, aborting: %d\n", bootHdr.osType); return LOADER_NOT_SUPPORT; } - + file_close(); return 0; } diff --git a/x86/context.c b/x86/context.c index a06b97d..988b6e5 100644 --- a/x86/context.c +++ b/x86/context.c @@ -33,7 +33,7 @@ static void start_main(void); /* forward decl. */ void __exit_context(void); /* assembly routine */
/* - * Main context structure + * Main context structure * It is placed at the bottom of our stack, and loaded by assembly routine * to start us up. */ @@ -87,7 +87,7 @@ struct context *init_context(u8 * stack, u32 stack_size, int num_params) { struct context *ctx;
- ctx = (struct context *) (stack + stack_size - + ctx = (struct context *) (stack + stack_size - (sizeof(*ctx) + num_params * sizeof(u32))); memset(ctx, 0, sizeof(*ctx));
diff --git a/x86/linux_load.c b/x86/linux_load.c index 4e41393..7bb37dd 100644 --- a/x86/linux_load.c +++ b/x86/linux_load.c @@ -592,10 +592,10 @@ static int load_initrd(struct linux_header *hdr, #if 0 else { /* Otherwise, see if we can put it above us. - * + * * This would be a good idea if we could easily find * out where the memory hole lives. - * + * * There's nothing wrong with the initrd living below * FILO. (stepan) * @@ -650,7 +650,7 @@ static void hardware_setup(void)
/* we're getting screwed again and again by this problem of the 8259. * so we're going to leave this lying around for inclusion into crt0.S - * on an as-needed basis. + * on an as-needed basis. * * well, that went ok, I hope. Now we have to reprogram the interrupts * :-( @@ -721,8 +721,8 @@ static int start_linux(u32 kern_addr, struct linux_params *params) linux_gdt[2] = gdt[FLAT_CODE]; linux_gdt[3] = gdt[FLAT_DATA]; /* 2.6 kernel uses 12 and 13, but head.S uses backward-compatible - * segments (2 and 3), so it SHOULD not be a problem. - * However, some distro kernels (eg. RH9) with backported threading + * segments (2 and 3), so it SHOULD not be a problem. + * However, some distro kernels (eg. RH9) with backported threading * patch use 12 and 13 also when booting... */ linux_gdt[12] = gdt[FLAT_CODE]; linux_gdt[13] = gdt[FLAT_DATA]; diff --git a/x86/segment.c b/x86/segment.c index ea38096..d82de3d 100644 --- a/x86/segment.c +++ b/x86/segment.c @@ -35,7 +35,7 @@ struct gdtarg { unsigned int base; } __attribute__ ((packed));
-/* How far the virtual address (used in C) is different from physical +/* How far the virtual address (used in C) is different from physical * address. Since we start in flat mode, the initial value is zero. */ unsigned long virt_offset = 0;
diff --git a/x86/switch.S b/x86/switch.S index 50f5f71..262b995 100644 --- a/x86/switch.S +++ b/x86/switch.S @@ -6,7 +6,7 @@ /* * Entry point * We start execution from here. - * It is assumed that CPU is in 32-bit protected mode and + * It is assumed that CPU is in 32-bit protected mode and * all segments are 4GB and base zero (flat model). */ entry: @@ -28,7 +28,7 @@ entry: * switches the stack, and restores everything from the new stack. * This function takes no argument. New stack pointer is * taken from global variable __context, and old stack pointer - * is also saved to __context. This way we can just jump to + * is also saved to __context. This way we can just jump to * this routine to get back to the original context. * * Call this routine with lcall or pushl %cs; call. @@ -51,7 +51,7 @@ __switch_context: xchgl %eax, 64(%esp) movl %eax, 60(%esp) #endif - + /* At this point we don't know if we are on flat segment * or relocated. So compute the address offset from %eip. * Assuming CS.base==DS.base==SS.base. @@ -62,7 +62,7 @@ __switch_context:
/* Interrupts are not allowed... */ cli - + /* Current context pointer is our stack pointer */ movl %esp, %esi
diff --git a/x86/wince_load.c b/x86/wince_load.c index 993815f..b4f317d 100644 --- a/x86/wince_load.c +++ b/x86/wince_load.c @@ -1,6 +1,6 @@ /******************************************************************************* * - * WindowsCE/i386 loader + * WindowsCE/i386 loader * * Copyright 2006 Andrei Birjukov andrei.birjukov@artecdesign.ee and * Artec Design LLC http://www.artecdesign.ee @@ -224,7 +224,7 @@ void wince_init_bootarg(u32 entryPoint) g_ppBootArgs = phys_to_virt(BOOTARG_PTR_LOCATION); *g_ppBootArgs = (void *) BOOTARG_LOCATION;
- // keep our BOOT_ARGS somewhere in a dry dark place + // keep our BOOT_ARGS somewhere in a dry dark place g_pBootArgs = phys_to_virt(BOOTARG_LOCATION);
debug("BOOT_ARGS at addr 0x%x, pointer at 0x%x [%x]\n", @@ -233,7 +233,7 @@ void wince_init_bootarg(u32 entryPoint)
memset(g_pBootArgs, 0, sizeof(BOOT_ARGS));
- // this data was copied from WinCE EDBG boot args + // this data was copied from WinCE EDBG boot args g_pBootArgs->ucEdbgAdapterType = EDBG_ADAPTER_DEFAULT; // use the first PCI NIC available g_pBootArgs->ucEdbgIRQ = 0; @@ -278,7 +278,7 @@ int wince_load(const char *file, const char *cmdline) file_close(); return LOADER_NOT_SUPPORT; } - // now read image start address and size + // now read image start address and size file_read((void *) &g_imageStart, sizeof(u32)); file_read((void *) &g_imageSize, sizeof(u32));
@@ -292,7 +292,7 @@ int wince_load(const char *file, const char *cmdline) printf("Windows CE BIN image, start 0x%x, length %d\n", g_imageStart, g_imageSize);
- // main image reading loop + // main image reading loop while (1) { // first grab the segment descriptor if (file_read(&segInfo, sizeof(SEGMENT_INFO)) < @@ -334,7 +334,7 @@ int wince_load(const char *file, const char *cmdline) // Look for ROMHDR to compute ROM offset. NOTE: romimage guarantees that the record containing // the TOC signature and pointer will always come before the record that contains the ROMHDR contents.
- if (segInfo.segSize == sizeof(ROMHDR) && + if (segInfo.segSize == sizeof(ROMHDR) && (*(u32 *) phys_to_virt(g_imageStart + ROM_SIGNATURE_OFFSET) == ROM_SIGNATURE)) { u32 tempOffset = (segInfo.segAddr - @@ -344,7 +344,7 @@ int wince_load(const char *file, const char *cmdline) ROMHDR *pROMhdr = (ROMHDR *) pDest;
// check to make sure this record really contains the ROMHDR. - if ((pROMhdr->physfirst == (g_imageStart - tempOffset)) && + if ((pROMhdr->physfirst == (g_imageStart - tempOffset)) && (pROMhdr->physlast == (g_imageStart - tempOffset + g_imageSize)) && (u32) (((pROMhdr-> dllfirst << 16) & 0xffff0000) <= pROMhdr->dlllast) && (u32) (((pROMhdr-> dllfirst << 16) & 0x0000ffff) <= pROMhdr->dlllast)) { @@ -376,7 +376,7 @@ int wince_load(const char *file, const char *cmdline) file_close();
// prepare the boot arguments - // note that the last segment size carries the launch address + // note that the last segment size carries the launch address wince_init_bootarg(segInfo.segSize);
// finally, call the generic launch() function