Skip to content

Commit 2124396

Browse files
committed
Trim leading spaces
1 parent 769aa9c commit 2124396

File tree

53 files changed

+193
-235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+193
-235
lines changed

examples/debugging/src/main.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ void main(void) {
1212
/* Set the intial value of some variables */
1313
int dbg_test_var_1 = 10;
1414
uint8_t dbg_test_var_2 = 3;
15-
15+
1616
/* Print a simple debugging string */
1717
dbg_sprintf(dbgout, "This is the start of a CEmu debugging test\n");
18-
18+
1919
/* Set a watchpoint that will break anytime we write/change this varaible */
2020
dbg_SetWriteWatchpoint(&dbg_test_var_1, sizeof dbg_test_var_1);
21-
21+
2222
/* Set a non breaking watchpoint just so we can see what is in this variable at any given time */
2323
dbg_SetWatchpoint(&dbg_test_var_2, sizeof dbg_test_var_2);
24-
24+
2525
/* Now, let's write to the varaible to see what happens (Go to the 'Watchpoints' tab in CEmu to view the status) */
2626
dbg_test_var_1 = 5;
27-
27+
2828
/* Remove the watchpoint that we had set */
2929
dbg_RemoveWatchpoint(&dbg_test_var_1);
3030
dbg_RemoveWatchpoint(&dbg_test_var_2);
@@ -35,4 +35,3 @@ void main(void) {
3535
/* Fail this assertion */
3636
assert(dbg_test_var_2);
3737
}
38-

examples/fileio_detect/src/main.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void main(void) {
2323
/* First couple bytes of the LibLoad AppVar, which is known to exist *
2424
/* Technically is a null-terminated string, if an odd looking one */
2525
const char search_string[] = { 0xFD, 0x21, 0x80, 0x00 };
26-
26+
2727
/* Clear the homescreen */
2828
os_ClrHome();
2929

@@ -32,10 +32,10 @@ void main(void) {
3232
/* Print the name of the variable (Should be LibLoad) */
3333
printText(0, y++, var_name);
3434
}
35-
35+
3636
/* Wait for a key */
3737
while (!os_GetCSC());
38-
38+
3939
/* Close all open files */
4040
ti_CloseAll();
4141
}
@@ -45,4 +45,3 @@ void printText(int8_t xpos, int8_t ypos, const char *text) {
4545
os_SetCursorPos(ypos, xpos);
4646
os_PutStrFull(text);
4747
}
48-

examples/fileio_factorize/src/main.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,44 +21,44 @@ void main(void) {
2121
list_t *list_out;
2222
unsigned i;
2323
int in;
24-
24+
2525
/* Clear the homescreen */
2626
os_ClrHome();
2727

2828
/* Get the answer variable */
2929
if (ti_RclVar(TI_REAL_TYPE, ti_Ans, &real_in)) return;
3030
if ((in = os_RealToInt24(real_in)) < 1) return;
31-
31+
3232
/* Get the prime factors of the input */
3333
prime_factors((unsigned)in);
34-
34+
3535
/* Create a list to store the primes */
3636
if (!total_primes) return;
3737
list_out = ti_MallocList(total_primes);
38-
38+
3939
/* Write out the list of primes */
4040
for (i=0; i<total_primes; i++) {
4141
list_out->items[i] = os_Int24ToReal(primes[i]);
4242
}
43-
43+
4444
/* Set the new answer */
4545
ti_SetVar(TI_REAL_LIST_TYPE, ti_Ans, list_out);
4646
}
4747

4848
/* Store to an array all the prime numbers */
4949
void prime_factors(unsigned int n) {
5050
unsigned int div, end;
51-
51+
5252
while (!(n % 2)) {
5353
primes[total_primes++] = 2;
5454
n /= 2;
5555
}
56-
56+
5757
if (n == 1) return;
58-
58+
5959
div = 3;
6060
end = sqrt(n);
61-
61+
6262
while (div <= end) {
6363
if (!(n % div)) {
6464
do {
@@ -70,7 +70,6 @@ void prime_factors(unsigned int n) {
7070
}
7171
div += 2;
7272
}
73-
73+
7474
primes[total_primes++] = n;
7575
}
76-

examples/fileio_os_vars/src/main.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,31 +27,31 @@ void main(void) {
2727
real_t real_1_5 = os_FloatToReal(1.5);
2828
real_t real_2_5 = os_FloatToReal(2.5);
2929
real_t real_3_5 = os_FloatToReal(3.5);
30-
30+
3131
/* Store the value '1.5+2.5i' into the varaible B */
3232
my_cplx = FloatsToCplx(1.5, 2.5);
3333
ti_SetVar(TI_CPLX_TYPE, ti_B, &my_cplx);
34-
34+
3535
/* Store the value '1.5' into the varaible A */
3636
my_real = real_1_5;
3737
ti_SetVar(TI_REAL_TYPE, ti_A, &my_real);
38-
38+
3939
/* Store the equation "2+2" into the Y1 variable */
4040
my_equ = ti_MallocEqu(3);
4141
my_equ->data[0] = '2';
4242
my_equ->data[1] = tAdd;
4343
my_equ->data[2] = '2';
4444
ti_SetVar(TI_EQU_TYPE, ti_Y1, my_equ);
4545
free(my_equ);
46-
46+
4747
/* Store the list {1.5,2.5,3.5} to L1 */
4848
my_list = ti_MallocList(3);
4949
my_list->items[0] = real_1_5;
5050
my_list->items[1] = real_2_5;
5151
my_list->items[2] = real_3_5;
5252
ti_SetVar(TI_REAL_LIST_TYPE, ti_L1, my_list);
5353
free(my_list);
54-
54+
5555
/* Store the matrix [[2.5,2.5]] to Ans */
5656
my_matrix = ti_MallocMatrix(1,2);
5757
matrix_element(my_matrix, 0, 0) = real_2_5;
@@ -99,4 +99,3 @@ cplx_t StrsToCplx(char *real, char **real_end, char *imag, char **imag_end) {
9999
res.imag.sign |= TI_CPLX_TYPE;
100100
return res;
101101
}
102-

examples/fileio_read_write/src/main.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ void printText(int8_t xpos, int8_t ypos, const char *text);
3030
void main(void) {
3131
ti_var_t myAppVar;
3232
int x;
33-
33+
3434
/* Clear the homescreen */
3535
os_ClrHome();
3636

3737
/* Declare some varaible values */
3838
strcpy(data.name, "My Data");
3939
data.var1 = VAR1_VALUE;
4040
data.var2 = VAR2_VALUE;
41-
41+
4242
/* Close any files that may be open already */
4343
ti_CloseAll();
44-
44+
4545
/* Open a new variable; deleting it if it already exists */
4646
myAppVar = ti_Open(appvarName, "w");
4747

@@ -59,17 +59,17 @@ void main(void) {
5959

6060
/* Make sure we read these varaibles correctly too */
6161
if (data.var1 != VAR1_VALUE && data.var2 != VAR2_VALUE) goto err;
62-
62+
6363
printText(0, 0, "Read was successful");
6464
goto noerr;
6565

6666
err:
6767
printText(0, 0, "An error occured");
6868
noerr:
69-
69+
7070
/* Pause */
7171
while (!os_GetCSC());
72-
72+
7373
/* Close all open files */
7474
ti_CloseAll();
7575
}
@@ -79,4 +79,3 @@ void printText(int8_t xpos, int8_t ypos, const char *text) {
7979
os_SetCursorPos(ypos, xpos);
8080
os_PutStrFull(text);
8181
}
82-

examples/fileio_tokens/src/main.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,25 @@ void main(void) {
2929

3030
/* Close any files that may be open already */
3131
ti_CloseAll();
32-
32+
3333
/* Open the program for reading */
3434
prgm = ti_OpenVar(prgmName, "r", TI_PRGM_TYPE);
35-
35+
3636
/* Make sure we opened okay */
3737
if (!prgm) goto err;
38-
38+
3939
data_ptr = ti_GetDataPtr(prgm);
4040
size = ti_GetSize(prgm);
4141

4242
while (size && y < 8) {
4343
printText(0, y++, ti_GetTokenString(&data_ptr, &token_length, NULL));
4444
size -= token_length;
4545
}
46-
46+
4747
err:
4848
/* Pause */
4949
while (!os_GetCSC());
50-
50+
5151
/* Close files */
5252
ti_CloseAll();
5353
}
@@ -57,4 +57,3 @@ void printText(int8_t xpos, int8_t ypos, const char *text) {
5757
os_SetCursorPos(ypos, xpos);
5858
os_PutStrFull(text);
5959
}
60-

examples/gfx_buffered_cube/src/main.c

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,34 +50,34 @@ void main(void) {
5050

5151
/* Seed the random numbers */
5252
srand(rtc_Time());
53-
53+
5454
/* Get some main variables set up */
5555
sin_angle = sin(ANG);
5656
cos_angle = cos(ANG);
5757
midx1 = (face1[0][0] + face1[1][0]) / 2.0;
5858
midy1 = (face1[1][1] + face1[2][1]) / 2.0;
5959
midx2 = (face2[0][0] + face2[1][0]) / 2.0;
6060
midy2 = (face2[1][1] + face2[2][1]) / 2.0;
61-
61+
6262
/* Start the graphics routines */
6363
gfx_Begin();
6464
gfx_SetDrawBuffer();
65-
65+
6666
/* Loop until a key is pressed */
6767
while (!os_GetCSC()) {
68-
68+
6969
/* Change the color of the cube depending on loop (mod 16) */
7070
if (!((loop++) & 0xf)) {
7171
gfx_SetColor(rand() & 0xfe);
7272
}
73-
73+
7474
/* Call the rotation code */
7575
rotate();
76-
76+
7777
/* Swap the buffer with the screen */
7878
gfx_SwapDraw();
7979
}
80-
80+
8181
/* End the graphics */
8282
gfx_End();
8383
}
@@ -86,30 +86,29 @@ void main(void) {
8686
void rotate(void) {
8787
uint8_t i;
8888
float tmp1, tmp2;
89-
89+
9090
/* Clear out the old rectangles */
9191
gfx_FillScreen(gfx_white);
92-
92+
9393
/* Compute the new face places */
9494
for (i=0; i<5; i++) {
9595
tmp1 = face1[i][0] - midx1;
9696
tmp2 = face1[i][1] - midy1;
97-
97+
9898
face1[i][0] = midx1 + (tmp1 * cos_angle) - (tmp2 * sin_angle);
9999
face1[i][1] = midy1 + (tmp1 * sin_angle) + (tmp2 * cos_angle);
100-
100+
101101
tmp1 = face2[i][0] - midx2;
102102
tmp2 = face2[i][1] - midy2;
103-
103+
104104
face2[i][0] = midx2 + (tmp1 * cos_angle) - (tmp2 * sin_angle);
105105
face2[i][1] = midy2 + (tmp1 * sin_angle) + (tmp2 * cos_angle);
106106
}
107-
107+
108108
/* Draw the cube itself */
109109
for (i=0; i<4; i++) {
110110
gfx_Line(face1[i][0], face1[i][1], face1[i+1][0], face1[i+1][1]);
111111
gfx_Line(face2[i][0], face2[i][1], face2[i+1][0], face2[i+1][1]);
112112
gfx_Line(face1[i][0], face1[i][1], face2[ i ][0], face2[ i ][1]);
113113
}
114114
}
115-

examples/gfx_buffering/src/main.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,34 @@
1414
void main(void) {
1515
/* Initialize the 8bpp graphics */
1616
gfx_Begin();
17-
17+
1818
/* Set up the palette */
1919
gfx_SetColor(gfx_black);
20-
20+
2121
/* Draw to buffer to avoid tearing */
2222
gfx_SetDrawBuffer();
23-
23+
2424
/* Draw a line on the buffer */
2525
//gfx_FillScreen(gfx_black);
2626
gfx_Line(0, 0, LCD_WIDTH - 1, LCD_HEIGHT - 1);
27-
27+
2828
/* Wait for a key */
2929
while (!os_GetCSC());
30-
30+
3131
/* Swap the buffer with the screen */
3232
gfx_SwapDraw();
33-
33+
3434
/* Copy part of the screen to the offscreen buffer */
3535
gfx_BlitBuffer();
3636
//gfx_BlitLines(gfx_buffer, 0, 20);
3737
//gfx_BlitRectangle(gfx_buffer, 0, 0, 160, 120);
38-
38+
3939
/* This should cause half of the line to flicker, and the other half to stay steady */
40-
40+
4141
while (!os_GetCSC()) {
4242
gfx_SwapDraw();
4343
}
44-
44+
4545
/* Close the graphics */
4646
gfx_End();
4747
}
48-

0 commit comments

Comments
 (0)