logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0001-require-standard-C-function-prototype-support.patch (3773B)


  1. From 32ae5e241237d325b8108660f82419ce684a62a8 Mon Sep 17 00:00:00 2001
  2. From: Mike Frysinger <vapier@gmail.com>
  3. Date: Mon, 8 Feb 2021 00:28:08 -0500
  4. Subject: [PATCH] require standard C function prototype support
  5. We can drop the main prototype entirely as we don't need it.
  6. ---
  7. Changes | 3 +++
  8. compress.c | 58 +++++++++++++++++++-----------------------------------
  9. 2 files changed, 23 insertions(+), 38 deletions(-)
  10. diff --git a/Changes b/Changes
  11. index 5bef4ec..40cd58d 100644
  12. --- a/Changes
  13. +++ b/Changes
  14. @@ -1,3 +1,6 @@
  15. +(N)compress version 5.1
  16. + * Use modern standard C function prototypes
  17. +
  18. (N)compress version 5.0
  19. * New stream for cleanups
  20. * Drop support for 2.0 output & -C option
  21. diff --git a/compress.c b/compress.c
  22. index 66cacf1..691ff2b 100644
  23. --- a/compress.c
  24. +++ b/compress.c
  25. @@ -168,12 +168,6 @@
  26. };
  27. #endif
  28. -#ifdef __STDC__
  29. -# define ARGS(a) a
  30. -#else
  31. -# define ARGS(a) ()
  32. -#endif
  33. -
  34. #ifndef SIG_TYPE
  35. # define SIG_TYPE void (*)()
  36. #endif
  37. @@ -527,17 +521,16 @@ long bytes_out; /* Total number of byte to output */
  38. } ;
  39. #endif
  40. -int main ARGS((int,char **));
  41. -void Usage ARGS((int));
  42. -void comprexx ARGS((const char *));
  43. -void compdir ARGS((char *));
  44. -void compress ARGS((int,int));
  45. -void decompress ARGS((int,int));
  46. -void read_error ARGS((void));
  47. -void write_error ARGS((void));
  48. -void abort_compress ARGS((void));
  49. -void prratio ARGS((FILE *,long,long));
  50. -void about ARGS((void));
  51. +void Usage (int);
  52. +void comprexx (const char *);
  53. +void compdir (char *);
  54. +void compress (int, int);
  55. +void decompress (int, int);
  56. +void read_error (void);
  57. +void write_error (void);
  58. +void abort_compress (void);
  59. +void prratio (FILE *, long, long);
  60. +void about (void);
  61. /*****************************************************************
  62. * TAG( main )
  63. @@ -580,9 +573,7 @@ void about ARGS((void));
  64. * procedure needs no input table, but tracks the way the table was built.
  65. */
  66. int
  67. -main(argc, argv)
  68. - int argc;
  69. - char *argv[];
  70. +main(int argc, char *argv[])
  71. {
  72. char **filelist;
  73. char **fileptr;
  74. @@ -794,8 +785,7 @@ Usage: %s [-dfhvcVr] [-b maxbits] [--] [path ...]\n\
  75. }
  76. void
  77. -comprexx(fileptr)
  78. - const char *fileptr;
  79. +comprexx(const char *fileptr)
  80. {
  81. int fdin = -1;
  82. int fdout = -1;
  83. @@ -1144,8 +1134,7 @@ error:
  84. #ifdef RECURSIVE
  85. void
  86. -compdir(dir)
  87. - char *dir;
  88. +compdir(char *dir)
  89. {
  90. struct dirent *dp;
  91. DIR *dirp;
  92. @@ -1221,9 +1210,7 @@ compdir(dir)
  93. * questions about this implementation to ames!jaw.
  94. */
  95. void
  96. -compress(fdin, fdout)
  97. - int fdin;
  98. - int fdout;
  99. +compress(int fdin, int fdout)
  100. {
  101. long hp;
  102. int rpos;
  103. @@ -1460,9 +1447,7 @@ endlop: if (fcode.e.ent >= FIRST && rpos < rsize)
  104. */
  105. void
  106. -decompress(fdin, fdout)
  107. - int fdin;
  108. - int fdout;
  109. +decompress(int fdin, int fdout)
  110. {
  111. char_type *stackp;
  112. code_int code;
  113. @@ -1687,7 +1672,7 @@ resetbuf: ;
  114. }
  115. void
  116. -read_error()
  117. +read_error(void)
  118. {
  119. fprintf(stderr, "\nread error on");
  120. perror((ifname[0] != '\0') ? ifname : "stdin");
  121. @@ -1695,7 +1680,7 @@ read_error()
  122. }
  123. void
  124. -write_error()
  125. +write_error(void)
  126. {
  127. fprintf(stderr, "\nwrite error on");
  128. perror(ofname ? ofname : "stdout");
  129. @@ -1703,7 +1688,7 @@ write_error()
  130. }
  131. void
  132. -abort_compress()
  133. +abort_compress(void)
  134. {
  135. if (remove_ofname)
  136. unlink(ofname);
  137. @@ -1712,10 +1697,7 @@ abort_compress()
  138. }
  139. void
  140. -prratio(stream, num, den)
  141. - FILE *stream;
  142. - long int num;
  143. - long int den;
  144. +prratio(FILE *stream, long int num, long int den)
  145. {
  146. int q; /* Doesn't need to be long */
  147. @@ -1739,7 +1721,7 @@ prratio(stream, num, den)
  148. }
  149. void
  150. -about()
  151. +about(void)
  152. {
  153. printf("Compress version: %s\n", version_id);
  154. printf("Compile options:\n ");
  155. --
  156. 2.49.0