Skip to content

Commit

Permalink
Several small cleanups.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-macke committed Nov 5, 2017
1 parent a2193f9 commit 4f97259
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ OBJS = reciter.o sam.o render.o main.o debug.o
CC = gcc

# libsdl present
CFLAGS = -Wall -Wpedantic -O2 -DUSESDL `sdl-config --cflags`
CFLAGS = -Wall -Os -DUSESDL `sdl-config --cflags`
LFLAGS = `sdl-config --libs`

# no libsdl present
#CFLAGS = -Wall -O2
#LFLAGS =
#CFLAGS = -Wall -Os
#LFLAGS =

sam: $(OBJS)
$(CC) -o sam $(OBJS) $(LFLAGS)

%.o: src/%.c
$(CC) $(CFLAGS) -c $<

package:
package:
tar -cvzf sam.tar.gz README.md Makefile sing src/

clean:
Expand Down
5 changes: 5 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ int main(int argc, char **argv)
char* wavfilename = NULL;
char input[256];

#ifdef USESDL
freopen("CON", "w", stdout);
freopen("CON", "w", stderr);
#endif

for(i=0; i<256; i++) input[i] = 0;

if (argc <= 1)
Expand Down
4 changes: 2 additions & 2 deletions src/render.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,8 +817,8 @@ if (debug)
unsigned int p1 = phase1 * 256; // Fixed point integers because we need to divide later on
unsigned int p2 = phase2 * 256;
unsigned int p3 = phase3 * 256;

for (int k=0; k<5; k++) {
int k;
for (k=0; k<5; k++) {
signed char sp1 = (signed char)sinus[0xff & (p1>>8)];
signed char sp2 = (signed char)sinus[0xff & (p2>>8)];
signed char rp3 = (signed char)rectangle[0xff & (p3>>8)];
Expand Down

0 comments on commit 4f97259

Please sign in to comment.