2N/A * GRUB -- GRand Unified Bootloader 2N/A * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. 2N/A * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. 2N/A * GRUB is free software: you can redistribute it and/or modify 2N/A * it under the terms of the GNU General Public License as published by 2N/A * the Free Software Foundation, either version 3 of the License, or 2N/A * (at your option) any later version. 2N/A * GRUB is distributed in the hope that it will be useful, 2N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of 2N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 2N/A * GNU General Public License for more details. 2N/A * You should have received a copy of the GNU General Public License 2N/A/* grub_gettext_dummy is not translating anything. */ 2N/A const char *s = (
const char *)
src;
2N/A/* GCC emits references to memcpy() for struct copies etc. */ 2N/A while ((*p++ = *
src++) !=
'\0')
2N/A while ((*p++ = *
src++) !=
'\0' && --c)
2N/A while (*s++ !=
'\0');
2N/A /* Crawl both the needle and the haystack word we're on. */ 2N/A /* If we reached the end of both words at the same time, the word 2N/A is found. If not, eat everything in the haystack that isn't the 2N/A next word (or the end of string) and "reset" the needle. */ 2N/A return (c ==
'\n' || c ==
'\r' || c ==
' ' || c ==
'\t');
2N/A return (c >=
' ' && c <=
'~');
2N/A /* Skip white spaces. */ 2N/A /* Guess the base, if not specified. The prefix `0x' means 16, and 2N/A the prefix `0' means 8. */ 2N/A /* NUM * BASE + DIGIT > ~0ULL */ 2N/A if (
len >=
3 *
sizeof (
unsigned long))
2N/A for (i = 0; i <
sizeof (
unsigned long); i++)
2N/A while (
len >=
sizeof (
unsigned long))
2N/A p = (
unsigned long *) p +
1;
2N/A len -=
sizeof (
unsigned long);
2N/A/* Divide N by D, return the quotient, and store the remainder in *R. */ 2N/A /* This algorithm is typically implemented by hardware. The idea 2N/A is to get the highest bit in N, 64 times, by keeping 2N/A upper(N * 2^i) = (Q * D + M), where upper 2N/A represents the high 64 bits in 128-bits space. */ 2N/A /* Skip the slow computation if 32-bit arithmetic is possible. */ 2N/A if (n <
0xffffffff && d <
0xffffffff)
2N/A if (n & (
1ULL <<
63))
2N/A/* Convert a long long value to a string. This function avoids 64-bit 2N/A modular arithmetic or divisions. */ 2N/A unsigned base = (c ==
'x') ?
16 :
10;
2N/A if ((
long long) n < 0 && c ==
'd')
2N/A n = (
unsigned long long) (-((
long long) n));
2N/A unsigned d = (
unsigned) (n &
0xf);
2N/A *p++ = (d >
9) ? d +
'a' -
10 : d +
'0';
2N/A /* Read formatting parameters. */ 2N/A if (*p && *p ==
'.')
2N/A/* Abort GRUB. This function does not return. */ 2N/A/* GCC emits references to abort(). */ 2N/A/* Some gcc versions generate a call to this function 2N/A in trampolines for nested functions. */ 2N/A/* Register a preboot hook. */