Skip to content

Commit 29f6ba2

Browse files
minor formatting changes
1 parent dfadd45 commit 29f6ba2

File tree

7 files changed

+13
-21
lines changed

7 files changed

+13
-21
lines changed

cpp4j/rationalnumber.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ RationalNumber rnMultiply
5757
RationalNumber rnDivide
5858
(const RationalNumber left,
5959
const RationalNumber right);
60+
6061
namespace rnum {
6162
class CPP_RationalNumber {
63+
6264
public :
6365

6466
CPP_RationalNumber
@@ -122,9 +124,10 @@ public :
122124
printf("%d %d \n" , rn.nominator, rn.denominator);
123125
}
124126

125-
126127
private:
128+
127129
RationalNumber rn;
130+
128131
};
129132

130133
/*CPP_RationalNumber operator*(const int left, const CPP_RationalNumber &right){

cpp4j/rationalnumberarray.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class CPP_RationalNumberArray;
7070
typedef void (*cppErrorCallback_t)(CPP_RationalNumberArray &rna);
7171

7272
class CPP_RationalNumberArray {
73+
7374
public :
7475

7576
CPP_RationalNumberArray (const unsigned int size = 10);
@@ -94,15 +95,20 @@ public :
9495
void rnaSetErrorCallback (const cppErrorCallback_t callback);
9596

9697
private:
98+
9799
void setError(const RNAErrorCode errorCode);
98-
//void initializeWithNullRationalNumber(const unsigned int from, const unsigned int to);
100+
99101
CPP_RationalNumber * m_data;
102+
100103
unsigned int m_size;
104+
101105
unsigned int m_capacity;
106+
102107
RNAErrorCode m_error;
108+
103109
cppErrorCallback_t m_errorCallback;
110+
104111
};
105112
}
106113

107-
108114
#endif // RATIONALNUMBERARRAY_H

cpp4j/testCPP_RN.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ void testCPP_RN(void)
1111
printf("Performing unit tests for CPP_RationalNumber...");
1212
fflush(stdout);
1313

14-
1514
CPP_RationalNumber a, x;
1615
CPP_RationalNumber b(0,1), c(2,3), d(9,3), e(-4,2), f(17,3);
1716

@@ -21,7 +20,6 @@ void testCPP_RN(void)
2120
x = -f + CPP_RationalNumber(3,4);
2221
assert( x == CPP_RationalNumber( -59 , 12 ));
2322

24-
2523
int i=5, j=4;
2624
CPP_RationalNumber g(1,2), h(7,3);
2725

cpp4j/testCPP_RNA.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
#include <stdio.h>
42
#include <assert.h>
53

@@ -13,9 +11,7 @@ void testCPP_RNA(void)
1311
printf("Performing unit tests for CPP_RationalNumberArray...");
1412
fflush(stdout);
1513

16-
17-
18-
CPP_RationalNumber
14+
CPP_RationalNumber
1915
rn1 = CPP_RationalNumber( 3, 4 ),
2016
rn2 = CPP_RationalNumber( 6, 4 ),
2117
rn3 = CPP_RationalNumber( 3, 2 ),
@@ -98,7 +94,6 @@ void testCPP_RNA(void)
9894
assert (rna.size() == 7);
9995
assert (rna.capacity() == 7);
10096

101-
10297
// remove elements: 3, 4, 5
10398
// elements 6.. become elements 3..
10499
rna.remove( 3, 5);
@@ -116,7 +111,5 @@ void testCPP_RNA(void)
116111
rna.remove( 0, 10);
117112
assert (rna.size() == 0);
118113

119-
120-
121114
printf(" successful!\n");
122115
}

cpp4j/testMain.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <stdio.h>
22

3-
43
#include "rationalnumber.h"
54

65
#include "testRN.cpp"
@@ -19,4 +18,3 @@ int main()
1918

2019
return 0;
2120
}
22-

cpp4j/testRN.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
#include "rationalnumber.h"
99

10-
11-
1210
void testRN()
1311
{
1412

@@ -47,4 +45,3 @@ void testRN()
4745
printf(" successful!\n");
4846

4947
}
50-

cpp4j/testRNA.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "rationalnumber.h"
99
#include "rationalnumberarray.h"
1010

11-
1211
const unsigned int wantedCapacity = 10;
1312

1413
bool errorCBCalled = false;
@@ -135,5 +134,3 @@ void testRNA(void)
135134

136135
printf(" successful!\n");
137136
}
138-
139-

0 commit comments

Comments
 (0)