OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

407 lines
11 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../quik/lib_update.patch
  5. # Copyright (C) 2004 - 2006 The T2 SDE Project
  6. # Copyright (C) 1998 - 2003 Clifford Wolf
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This patch file is dual-licensed. It is available under the license the
  11. # patched project is licensed under, as long as it is an OpenSource license
  12. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  13. # of the GNU General Public License as published by the Free Software
  14. # Foundation; either version 2 of the License, or (at your option) any later
  15. # version.
  16. # --- SDE-COPYRIGHT-NOTE-END ---
  17. --- ./quik/quik.c 2002-06-05 08:04:29.000000000 -0400
  18. +++ ./quik/quik.c 2002-12-14 19:04:12.000000000 -0500
  19. @@ -225,7 +225,7 @@
  20. strcat(buffer, path + 1);
  21. return buffer;
  22. } else
  23. - return strdup(path);
  24. + return (char *) strdup(path);
  25. }
  26. void write_block_table(char *device, char *config_file, int partno)
  27. --- ./second/cfg.c 2002-06-05 08:04:29.000000000 -0400
  28. +++ ./second/cfg.c 2002-12-14 18:53:49.000000000 -0500
  29. @@ -98,10 +98,10 @@
  30. va_list ap;
  31. va_start (ap, msg);
  32. - printf ("Config file error: ");
  33. - vprintf (msg, ap);
  34. + q_printf ("Config file error: ");
  35. + q_vprintf (msg, ap);
  36. va_end (ap);
  37. - printf (" near line %d in file %s\n", line_num, file_name);
  38. + q_printf (" near line %d in file %s\n", line_num, file_name);
  39. longjmp (env, 1);
  40. }
  41. @@ -110,10 +110,10 @@
  42. va_list ap;
  43. va_start (ap, msg);
  44. - printf ("Config file warning: ");
  45. - vprintf (msg, ap);
  46. + q_printf ("Config file warning: ");
  47. + q_vprintf (msg, ap);
  48. va_end (ap);
  49. - printf (" near line %d in file %s\n", line_num, file_name);
  50. + q_printf (" near line %d in file %s\n", line_num, file_name);
  51. }
  52. inline int getc ()
  53. @@ -371,8 +371,8 @@
  54. int len = strlen (label);
  55. if (!printl_count)
  56. - printf ("\n");
  57. - printf ("%s", label);
  58. + q_printf ("\n");
  59. + q_printf ("%s", label);
  60. while (len++ < 25)
  61. putchar (' ');
  62. printl_count++;
  63. @@ -399,7 +399,7 @@
  64. if (alias)
  65. printlabel (alias);
  66. }
  67. - printf ("\nYou can also type in custom image locations, in the form\n"
  68. + q_printf ("\nYou can also type in custom image locations, in the form\n"
  69. "{prom_path;}partno/path_to_image or {prom_path;}{partno}[start-end]\n");
  70. }
  71. --- ./second/disk.c 2000-03-10 15:59:28.000000000 -0500
  72. +++ ./second/disk.c 2002-12-14 18:54:37.000000000 -0500
  73. @@ -10,7 +10,7 @@
  74. {
  75. current_dev = call_prom("open", 1, 1, device);
  76. if (current_dev == (ihandle) 0 || current_dev == (ihandle) -1) {
  77. - printf("\nCouldn't open %s\n", device);
  78. + q_printf("\nCouldn't open %s\n", device);
  79. return -1;
  80. }
  81. strcpy(current_devname, device);
  82. @@ -53,7 +53,7 @@
  83. * just a few partitions. -- Cort
  84. */
  85. if ( is_chrp )
  86. - sprintf(bootdevice, "disk:0");
  87. + q_sprintf(bootdevice, "disk:0");
  88. if( open(bootdevice) )
  89. {
  90. /*
  91. @@ -61,7 +61,7 @@
  92. * try this if disk:0 fails
  93. * -- Cort
  94. */
  95. - sprintf(bootdevice, "/pci@fee00000/scsi@c/sd@8:0");
  96. + q_sprintf(bootdevice, "/pci@fee00000/scsi@c/sd@8:0");
  97. return open(bootdevice);
  98. }
  99. return 0;
  100. --- ./second/file.c 2002-06-05 08:04:29.000000000 -0400
  101. +++ ./second/file.c 2002-12-14 18:59:19.000000000 -0500
  102. @@ -23,7 +23,7 @@
  103. #include <sys/types.h>
  104. #include <errno.h>
  105. #include "quik.h"
  106. -typedef int FILE;
  107. +typedef int q_FILE;
  108. #include <linux/ext2_fs.h>
  109. #include <ext2fs/ext2fs.h>
  110. #include <setjmp.h>
  111. @@ -155,7 +155,7 @@
  112. /* check the MSDOS partition magic */
  113. if ( (blk[0x1fe] != 0x55) || (blk[0x1ff] != 0xaa) )
  114. {
  115. - printf("No MSDOS partition magic number on disk!\n");
  116. + q_printf("No MSDOS partition magic number on disk!\n");
  117. return 0;
  118. }
  119. if ( part >= 4 )
  120. @@ -167,14 +167,14 @@
  121. return 1;
  122. }
  123. -int sprintf (char *buf, char *fmt,...)
  124. +int q_sprintf (char *buf, char *fmt,...)
  125. {
  126. strcpy (buf, fmt);
  127. }
  128. void com_err (const char *a, long i, const char *fmt,...)
  129. {
  130. - printf ((char *) fmt);
  131. + q_printf ((char *) fmt);
  132. }
  133. static errcode_t linux_open (const char *name, int flags, io_channel * channel)
  134. @@ -222,7 +222,7 @@
  135. tempb = (((long long) block) * ((long long)bs)) + doff;
  136. size = (count < 0) ? -count : count * bs;
  137. if (read (data, size, tempb) != size) {
  138. - printf ("\nRead error on block %d", block);
  139. + q_printf ("\nRead error on block %d", block);
  140. return EXT2_ET_SHORT_READ;
  141. }
  142. return 0;
  143. @@ -253,7 +253,7 @@
  144. static char rot[] = "\\|/-";
  145. if (!(i % freq))
  146. - printf ("%c\b", rot[(i / freq) % 4]);
  147. + q_printf ("%c\b", rot[(i / freq) % 4]);
  148. i++;
  149. }
  150. @@ -314,7 +314,7 @@
  151. block_cnt = 0;
  152. retval = ext2fs_block_iterate(fs, inode, 0, 0, dump_block, 0);
  153. if (retval) {
  154. - printf ("Error %d reading %s", retval, filename);
  155. + q_printf ("Error %d reading %s", retval, filename);
  156. return 0;
  157. }
  158. return dump_finish();
  159. @@ -342,7 +342,7 @@
  160. }
  161. }
  162. if (end == -1) {
  163. - printf ("\n"
  164. + q_printf ("\n"
  165. "Ranges of physical blocks are specified as {prom_path:}{partno}[xx-yy]\n"
  166. "where {} means optional part, partno defaults to 0 (i.e. whole disk)\n"
  167. "and xx is the starting block (chunk of 512 bytes) and yy end (not\n"
  168. @@ -369,7 +369,7 @@
  169. }
  170. }
  171. }
  172. - printf ("\nInternal error while loading blocks from device\n");
  173. + q_printf ("\nInternal error while loading blocks from device\n");
  174. return 0;
  175. }
  176. @@ -406,7 +406,7 @@
  177. }
  178. type = ext2;
  179. if (retval = ext2fs_namei(fs, root, cwd, filename, &inode)) {
  180. - printf("\nInode error #%d while loading file %s.", retval, filename);
  181. + q_printf("\nInode error #%d while loading file %s.", retval, filename);
  182. ext2fs_close(fs);
  183. return 0;
  184. }
  185. --- ./second/main.c 2002-06-05 08:04:29.000000000 -0400
  186. +++ ./second/main.c 2002-12-14 18:57:18.000000000 -0500
  187. @@ -57,14 +57,14 @@
  188. void fatal(const char *msg)
  189. {
  190. - printf("\nFatal error: %s\n", msg);
  191. + q_printf("\nFatal error: %s\n", msg);
  192. }
  193. void maintabfunc (void)
  194. {
  195. if (useconf) {
  196. cfg_print_images();
  197. - printf("boot: %s", cbuff);
  198. + q_printf("boot: %s", cbuff);
  199. }
  200. }
  201. @@ -217,7 +217,7 @@
  202. if (useconf && (q = cfg_get_strg(0, "timeout")) != 0 && *q != 0)
  203. timeout = strtol(q, NULL, 0);
  204. }
  205. - printf("boot: ");
  206. + q_printf("boot: ");
  207. c = -1;
  208. if (timeout != -1) {
  209. beg = get_ms();
  210. @@ -232,14 +232,14 @@
  211. }
  212. if (c == '\n') {
  213. - printf("%s", imagename);
  214. + q_printf("%s", imagename);
  215. if (*params)
  216. - printf(" %s", *params);
  217. - printf("\n");
  218. + q_printf(" %s", *params);
  219. + q_printf("\n");
  220. } else {
  221. cmdinit();
  222. cmdedit(maintabfunc, c);
  223. - printf("\n");
  224. + q_printf("\n");
  225. strcpy(given_bootargs, cbuff);
  226. given_bootargs_by_user = 1;
  227. imagename = cbuff;
  228. @@ -296,7 +296,7 @@
  229. if (!*device)
  230. *device = defdevice;
  231. if (!*kname)
  232. - printf(
  233. + q_printf(
  234. "Enter the kernel image name as [device:][partno]/path, where partno is a\n"
  235. "number from 0 to 16. Instead of /path you can type [mm-nn] to specify a\n"
  236. "range of disk blocks (512B)\n");
  237. @@ -328,7 +328,7 @@
  238. device = cfg_get_strg(0, "device");
  239. if (load_file(device, part, kname, TMP_BUF, TMP_END, &len, 1, 0)) {
  240. TMP_BUF[len] = 0;
  241. - printf("\n%s", (char *)TMP_BUF);
  242. + q_printf("\n%s", (char *)TMP_BUF);
  243. }
  244. }
  245. }
  246. @@ -377,7 +377,7 @@
  247. if ( (unsigned long)prom_entry == 0x426f6f58 )
  248. {
  249. - printf("BootX launched us\n");
  250. + q_printf("BootX launched us\n");
  251. prom_entry = (void *)id;
  252. /*
  253. * These should come from the bootx info.
  254. @@ -391,7 +391,7 @@
  255. memset(&__bss_start, 0, &_end - &__bss_start);
  256. prom_init(prom_entry);
  257. - printf("Second-stage QUIK loader\n");
  258. + q_printf("Second-stage QUIK loader\n");
  259. if (diskinit() == -1)
  260. prom_exit();
  261. @@ -403,24 +403,24 @@
  262. fileok = load_file(0, quik_conf_part, quik_conf,
  263. TMP_BUF, TMP_END, &len, 1, 0);
  264. if (!fileok || (unsigned) len >= 65535)
  265. - printf("\nCouldn't load %s\n", quik_conf);
  266. + q_printf("\nCouldn't load %s\n", quik_conf);
  267. else {
  268. char *p;
  269. if (cfg_parse(quik_conf, TMP_BUF, len) < 0)
  270. - printf ("Syntax error or read error in %s.\n", quik_conf);
  271. + q_printf ("Syntax error or read error in %s.\n", quik_conf);
  272. useconf = 1;
  273. p = cfg_get_strg(0, "init-code");
  274. if (p)
  275. call_prom("interpret", 1, 1, p);
  276. p = cfg_get_strg(0, "init-message");
  277. if (p)
  278. - printf("%s", p);
  279. + q_printf("%s", p);
  280. p = cfg_get_strg(0, "message");
  281. if (p)
  282. print_message_file(p);
  283. }
  284. } else
  285. - printf ("\n");
  286. + q_printf ("\n");
  287. for (;;) {
  288. get_params(&device, &part, &kname, &params);
  289. @@ -431,11 +431,11 @@
  290. TMP_BUF, TMP_END, &image_len, 1, 0);
  291. if (!fileok) {
  292. - printf ("\nImage not found.... try again\n");
  293. + q_printf ("\nImage not found.... try again\n");
  294. continue;
  295. }
  296. if (image_len > TMP_END - TMP_BUF) {
  297. - printf("\nImage is too large (%u > %u)\n", image_len,
  298. + q_printf("\nImage is too large (%u > %u)\n", image_len,
  299. TMP_END - TMP_BUF);
  300. continue;
  301. }
  302. @@ -448,13 +448,13 @@
  303. e->e_ident[EI_MAG1] == ELFMAG1 &&
  304. e->e_ident[EI_MAG2] == ELFMAG2 &&
  305. e->e_ident[EI_MAG3] == ELFMAG3)) {
  306. - printf ("\n%s: unknown image format\n", kname);
  307. + q_printf ("\n%s: unknown image format\n", kname);
  308. continue;
  309. }
  310. if (e->e_ident[EI_CLASS] != ELFCLASS32
  311. || e->e_ident[EI_DATA] != ELFDATA2MSB) {
  312. - printf("Image is not a 32bit MSB ELF image\n");
  313. + q_printf("Image is not a 32bit MSB ELF image\n");
  314. continue;
  315. }
  316. len = 0;
  317. @@ -470,7 +470,7 @@
  318. len = p->p_offset + p->p_filesz - off;
  319. }
  320. if (len == 0) {
  321. - printf("Cannot find a loadable segment in ELF image\n");
  322. + q_printf("Cannot find a loadable segment in ELF image\n");
  323. continue;
  324. }
  325. entry = e->e_entry & ADDRMASK;
  326. @@ -488,9 +488,9 @@
  327. close();
  328. if (pause_after) {
  329. - printf("%s", pause_message);
  330. + q_printf("%s", pause_message);
  331. prom_pause();
  332. - printf("\n");
  333. + q_printf("\n");
  334. }
  335. /*
  336. @@ -509,12 +509,12 @@
  337. /* doesn't look like a procedure descriptor */
  338. start += entry;
  339. }
  340. - printf("Starting at %x\n", start);
  341. + q_printf("Starting at %x\n", start);
  342. #ifdef BOOTINFO
  343. /* setup the bootinfo */
  344. binf.magic_start = bin.magic_end = BOOT_INFO_MAGIC;
  345. - sprintf( binf.cmd_line, "%s", params );
  346. - sprintf( binf.boot_loader, "Quik" );
  347. + q_sprintf( binf.cmd_line, "%s", params );
  348. + q_sprintf( binf.boot_loader, "Quik" );
  349. if ( is_chrp )
  350. binf._machine = _MACH_chrp;
  351. else
  352. --- ./second/printf.c 2000-03-10 15:59:28.000000000 -0500
  353. +++ ./second/printf.c 2002-12-14 18:58:02.000000000 -0500
  354. @@ -20,23 +20,23 @@
  355. #include "quik.h"
  356. static void printn(long, int);
  357. -extern void vprintf(char *, va_list);
  358. +extern void q_vprintf(char *, va_list);
  359. /*
  360. * Scaled down version of C Library printf.
  361. * Only %c %s %u %d (==%u) %o %x %D %O are recognized.
  362. */
  363. -void printf (char *fmt,...)
  364. +void q_printf (char *fmt,...)
  365. {
  366. va_list x1;
  367. va_start (x1, fmt);
  368. - vprintf (fmt, x1);
  369. + q_vprintf (fmt, x1);
  370. va_end (x1);
  371. }
  372. -void vprintf (char *fmt, va_list adx)
  373. +void q_vprintf (char *fmt, va_list adx)
  374. {
  375. register c;
  376. char *s;