Merge pull request #887 from xexyl/2001-coupard
This commit is contained in:
3 files changed
+23
-4
No files matched your search
+1
-1
@@ -20,7 +20,7 @@ _O: while (!(k['a'] <<= - dup)) { /*/*\*/
|
|||||||
while(b = 3, i); {
|
while(b = 3, i); {
|
||||||
k['a'] = b,i;
|
k['a'] = b,i;
|
||||||
_0:if(b&&(int)k+
|
_0:if(b&&(int)k+
|
||||||
sin(signal) / * ((main) (((struct tag *)b)-> xO)));/*}
|
sin(signal) / * ((main) (*((struct tag *)b)-> xO)));/*}
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ $",p[6789];
|
|||||||
|
|
||||||
int o[]={145,1145,1745,2545,3045,4045,4345,5145,5745,6369},i=0,j=0,l=0;
|
int o[]={145,1145,1745,2545,3045,4045,4345,5145,5745,6369},i=0,j=0,l=0;
|
||||||
|
|
||||||
void e(n,h){
|
void e(int n,int h){
|
||||||
for(j=0;n>0;n-=!(p[j++]^9));
|
for(j=0;n>0;n-=!(p[j++]^9));
|
||||||
for(;!n&&j[p]^9;j++)write(1,p+p[j][o],o[p[j]+1]-p[j][o]);
|
for(;!n&&j[p]^9;j++)write(1,p+p[j][o],o[p[j]+1]-p[j][o]);
|
||||||
for(i=0;i<h[o];i++)write(1,d+7,1);}
|
for(i=0;i<h[o];i++)write(1,d+7,1);}
|
||||||
|
|||||||
+21
-2
@@ -64,8 +64,10 @@ Scovell](https://web.archive.org/web/20070120220721/https://thomasscovell.com/ta
|
|||||||
Cody fixed this to not require `-traditional-cpp` which not all compilers
|
Cody fixed this to not require `-traditional-cpp` which not all compilers
|
||||||
support (clang does not support it for example). Clang is also more strict about
|
support (clang does not support it for example). Clang is also more strict about
|
||||||
the args' types in `main()` and this was also a problem that Cody fixed, making
|
the args' types in `main()` and this was also a problem that Cody fixed, making
|
||||||
it work with both clang and gcc. For the original code with the gcc fix
|
it work with both clang and gcc - in macOS. It was then noticed that with clang
|
||||||
described below, see the alternate code section in the README.md file.
|
in linux it did not work so this had to be further fixed which Cody also did.
|
||||||
|
For the original code with the gcc fix (noted below), see the alternate code
|
||||||
|
section in the README.md file.
|
||||||
|
|
||||||
Originally Yusuke supplied a patch so that this entry would compile with gcc -
|
Originally Yusuke supplied a patch so that this entry would compile with gcc -
|
||||||
but not clang - or at least some versions.
|
but not clang - or at least some versions.
|
||||||
@@ -912,6 +914,23 @@ valid, btw.
|
|||||||
|
|
||||||
## [2001/coupard](2001/coupard/coupard.c) ([README.md](2001/coupard/README.md]))
|
## [2001/coupard](2001/coupard/coupard.c) ([README.md](2001/coupard/README.md]))
|
||||||
|
|
||||||
|
Cody fixed this to compile with clang in linux. The problem was C99 does not
|
||||||
|
support implicit int:
|
||||||
|
|
||||||
|
```c
|
||||||
|
coupard.c:31:10: error: parameter 'h' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
|
||||||
|
void e(n,h){
|
||||||
|
^
|
||||||
|
coupard.c:31:8: error: parameter 'n' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
|
||||||
|
void e(n,h){
|
||||||
|
^
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
One fix would be to disable that warning. Another one might be to change the C
|
||||||
|
standard. The one that was done, to make it more portable, was to just add 'int'
|
||||||
|
to the function parameters.
|
||||||
|
|
||||||
Thanks go to Yusuke for providing a proper command line for macOS (to do with
|
Thanks go to Yusuke for providing a proper command line for macOS (to do with
|
||||||
sound; see his [/2013/endoh3/README.md](2013/endoh3/README.md) entry where he
|
sound; see his [/2013/endoh3/README.md](2013/endoh3/README.md) entry where he
|
||||||
also refers to sound devices in macOS).
|
also refers to sound devices in macOS).
|
||||||
|
|||||||
Reference in new issue
Block a user