"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "htmldoc/util.cxx" between
htmldoc-1.9.12-source.tar.gz and htmldoc-1.9.13-source.tar.gz

About: HTMLDOC converts HTML and Markdown source files into indexed HTML, EPUB, PostScript, or PDF files (but doesn’t support CSS).

util.cxx  (htmldoc-1.9.12-source):util.cxx  (htmldoc-1.9.13-source)
skipping to change at line 37 skipping to change at line 37
static const char *ones[10] = /* Roman numerals, 0-9 */ static const char *ones[10] = /* Roman numerals, 0-9 */
{ {
"", "i", "ii", "iii", "iv", "", "i", "ii", "iii", "iv",
"v", "vi", "vii", "viii", "ix" "v", "vi", "vii", "viii", "ix"
}, },
*tens[10] = /* Roman numerals, 10-90 */ *tens[10] = /* Roman numerals, 10-90 */
{ {
"", "x", "xx", "xxx", "xl", "", "x", "xx", "xxx", "xl",
"l", "lx", "lxx", "lxxx", "xc" "l", "lx", "lxx", "lxxx", "xc"
}, },
*hundreds[10] = /* Roman numerals, 100-900 */ *hundreds[30] = /* Roman numerals, 100-2900 */
{ {
"", "c", "cc", "ccc", "cd", "", "c", "cc", "ccc", "cd",
"d", "dc", "dcc", "dccc", "cm" "d", "dc", "dcc", "dccc", "cm",
"m", "mc", "cc", "ccc", "cd",
"m", "mdc", "mdcc", "mdccc", "mcm",
"mm", "mmc", "mmcc", "mmccc", "mmcd",
"mmd", "mmdc", "mmdcc", "mmdccc", "mmcm"
}; };
static const char *ONES[10] = /* Roman numerals, 0-9 */ static const char *ONES[10] = /* Roman numerals, 0-9 */
{ {
"", "I", "II", "III", "IV", "", "I", "II", "III", "IV",
"V", "VI", "VII", "VIII", "IX" "V", "VI", "VII", "VIII", "IX"
}, },
*TENS[10] = /* Roman numerals, 10-90 */ *TENS[10] = /* Roman numerals, 10-90 */
{ {
"", "X", "XX", "XXX", "XL", "", "X", "XX", "XXX", "XL",
"L", "LX", "LXX", "LXXX", "XC" "L", "LX", "LXX", "LXXX", "XC"
}, },
*HUNDREDS[10] = /* Roman numerals, 100-900 */ *HUNDREDS[30] = /* Roman numerals, 100-2900 */
{ {
"", "C", "CC", "CCC", "CD", "", "C", "CC", "CCC", "CD",
"D", "DC", "DCC", "DCCC", "CM" "D", "DC", "DCC", "DCCC", "CM",
"M", "MC", "CC", "CCC", "CD",
"M", "MDC", "MDCC", "MDCCC", "MCM",
"MM", "MMC", "MMCC", "MMCCC", "MMCD",
"MMD", "MMDC", "MMDCC", "MMDCCC", "MMCM"
}; };
static char buffer[1024]; /* String buffer */ static char buffer[1024]; /* String buffer */
switch (f) switch (f)
{ {
default : default :
buffer[0] = '\0'; buffer[0] = '\0';
break; break;
case 'a' : case 'a' :
if (n >= (26 * 26)) if (n > (26 * 26))
buffer[0] = '\0'; n = (n % (26 * 26)) + 1;
else if (n > 26)
if (n > 26)
snprintf(buffer, sizeof(buffer), "%c%c", 'a' + (n / 26) - 1, 'a' + (n % 26) - 1); snprintf(buffer, sizeof(buffer), "%c%c", 'a' + (n / 26) - 1, 'a' + (n % 26) - 1);
else else
snprintf(buffer, sizeof(buffer), "%c", 'a' + n - 1); snprintf(buffer, sizeof(buffer), "%c", 'a' + n - 1);
break; break;
case 'A' : case 'A' :
if (n >= (26 * 26)) if (n > (26 * 26))
buffer[0] = '\0'; n = (n % (26 * 26)) + 1;
else if (n > 26)
if (n > 26)
snprintf(buffer, sizeof(buffer), "%c%c", 'A' + (n / 26) - 1, 'A' + (n % 26) - 1); snprintf(buffer, sizeof(buffer), "%c%c", 'A' + (n / 26) - 1, 'A' + (n % 26) - 1);
else else
snprintf(buffer, sizeof(buffer), "%c", 'A' + n - 1); snprintf(buffer, sizeof(buffer), "%c", 'A' + n - 1);
break; break;
case '1' : case '1' :
snprintf(buffer, sizeof(buffer), "%d", n); snprintf(buffer, sizeof(buffer), "%d", n);
break; break;
case 'i' : case 'i' :
if (n >= 1000) if (n >= 3000)
buffer[0] = '\0'; n = ((n - 3000) % 2999) + 1;
else
snprintf(buffer, sizeof(buffer), "%s%s%s", hundreds[n / 100], tens[(n snprintf(buffer, sizeof(buffer), "%s%s%s", hundreds[n / 100], tens[(n / 1
/ 10) % 10], ones[n % 10]); 0) % 10], ones[n % 10]);
break; break;
case 'I' : case 'I' :
if (n >= 1000) if (n >= 3000)
buffer[0] = '\0'; n = ((n - 3000) % 2999) + 1;
else
snprintf(buffer, sizeof(buffer), "%s%s%s", HUNDREDS[n / 100], TENS[(n snprintf(buffer, sizeof(buffer), "%s%s%s", HUNDREDS[n / 100], TENS[(n / 1
/ 10) % 10], ONES[n % 10]); 0) % 10], ONES[n % 10]);
break; break;
} }
return (buffer); return (buffer);
} }
/* /*
* 'get_color()' - Get a standard color value... * 'get_color()' - Get a standard color value...
*/ */
 End of changes. 8 change blocks. 
22 lines changed or deleted 32 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)