diff options
author | Siddhesh Wani | 2017-07-04 19:55:17 +0530 |
---|---|---|
committer | GitHub | 2017-07-04 19:55:17 +0530 |
commit | e7a1a9bd776aa3ebdd13aea4d4ef838e65acb34c (patch) | |
tree | 749b476d7653774c918af42ebd952d4050ed49b6 /2.3-1/src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c | |
parent | c66867c874436fb37ef54c67b048885ce094e894 (diff) | |
parent | 8889f4a5edad040f47c3fcb717053352ab0d05b8 (diff) | |
download | Scilab2C-e7a1a9bd776aa3ebdd13aea4d4ef838e65acb34c.tar.gz Scilab2C-e7a1a9bd776aa3ebdd13aea4d4ef838e65acb34c.tar.bz2 Scilab2C-e7a1a9bd776aa3ebdd13aea4d4ef838e65acb34c.zip |
Merge pull request #13 from jschandi/master
Fixed standalone conversion errors with RPi files
Diffstat (limited to '2.3-1/src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c')
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/2.3-1/src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c b/2.3-1/src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c index 3d586232..121d26ae 100644 --- a/2.3-1/src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c +++ b/2.3-1/src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c @@ -31,7 +31,8 @@ uint8 u8gcdua(uint8* in,int size) int x=*in; int y=*(in+1); int max=(x>y)?x:y; - for(int i=max;i>=1;i--) + int i; + for(i=max;i>=1;i--) { if(x%i==0 && y%i==0) { @@ -39,12 +40,13 @@ uint8 u8gcdua(uint8* in,int size) break; } } - for(int j=2;j<size;j++) + int j; + for(j=2;j<size;j++) { x=temp; y=*(in+j); max=(x>y)?x:y; - for(int i=max;i>=1;i--) + for(i=max;i>=1;i--) { if(x%i==0 && y%i==0) { |