summaryrefslogtreecommitdiff
path: root/src/c/elementaryFunctions/discrete_mathematics
diff options
context:
space:
mode:
authorJorawar Singh2017-07-04 15:14:46 +0530
committerJorawar Singh2017-07-04 15:14:46 +0530
commit121b455e1e46617c670a8b9dfa77bbb1aa97a51a (patch)
treed4ebfb141c8036c3d59c0ac9007003f79ed68d02 /src/c/elementaryFunctions/discrete_mathematics
parenta3dfa2a4069740517ca6e83f99dd4e0dbb71c377 (diff)
downloadScilab2C_fossee_old-121b455e1e46617c670a8b9dfa77bbb1aa97a51a.tar.gz
Scilab2C_fossee_old-121b455e1e46617c670a8b9dfa77bbb1aa97a51a.tar.bz2
Scilab2C_fossee_old-121b455e1e46617c670a8b9dfa77bbb1aa97a51a.zip
Fixed standalone conversion errors with RPi files
Diffstat (limited to 'src/c/elementaryFunctions/discrete_mathematics')
-rw-r--r--src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c8
-rw-r--r--src/c/elementaryFunctions/discrete_mathematics/lcm/u8lcma.c3
2 files changed, 7 insertions, 4 deletions
diff --git a/src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c b/src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c
index 3d58623..121d26a 100644
--- a/src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c
+++ b/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)
{
diff --git a/src/c/elementaryFunctions/discrete_mathematics/lcm/u8lcma.c b/src/c/elementaryFunctions/discrete_mathematics/lcm/u8lcma.c
index 56856e4..b01c804 100644
--- a/src/c/elementaryFunctions/discrete_mathematics/lcm/u8lcma.c
+++ b/src/c/elementaryFunctions/discrete_mathematics/lcm/u8lcma.c
@@ -44,7 +44,8 @@ uint8 u8lcma(uint8* in,int size)
else
i+=max;
}
- for(int j=2;j<size;j++)
+ int j;
+ for(j=2;j<size;j++)
{
x1=lcm_temp;
x2=*(in+j);