[llvm-commits] CVS: llvm-test/MultiSource/Applications/hexxagon/Makefile hexxagon.cpp
John Criswell
criswell at cs.uiuc.edu
Fri Sep 10 13:56:33 PDT 2004
Changes in directory llvm-test/MultiSource/Applications/hexxagon:
Makefile updated: 1.1 -> 1.2
hexxagon.cpp updated: 1.1 -> 1.2
---
Log message:
Removed the need for GNU readline.
---
Diffs of the changes: (+7 -12)
Index: llvm-test/MultiSource/Applications/hexxagon/Makefile
diff -u llvm-test/MultiSource/Applications/hexxagon/Makefile:1.1 llvm-test/MultiSource/Applications/hexxagon/Makefile:1.2
--- llvm-test/MultiSource/Applications/hexxagon/Makefile:1.1 Fri Sep 10 09:25:52 2004
+++ llvm-test/MultiSource/Applications/hexxagon/Makefile Fri Sep 10 15:56:20 2004
@@ -1,7 +1,7 @@
LEVEL = ../../..
PROG = hexxagon
REQUIRES_EH_SUPPORT = 1
-LDFLAGS += -lstdc++ -lreadline -ltermcap
-LIBS += -lstdc++ -lreadline -ltermcap
+LDFLAGS += -lstdc++ -ltermcap
+LIBS += -lstdc++ -ltermcap
STDIN_FILENAME=$(BUILD_SRC_DIR)/input
include ../../Makefile.multisrc
Index: llvm-test/MultiSource/Applications/hexxagon/hexxagon.cpp
diff -u llvm-test/MultiSource/Applications/hexxagon/hexxagon.cpp:1.1 llvm-test/MultiSource/Applications/hexxagon/hexxagon.cpp:1.2
--- llvm-test/MultiSource/Applications/hexxagon/hexxagon.cpp:1.1 Fri Sep 10 09:25:52 2004
+++ llvm-test/MultiSource/Applications/hexxagon/hexxagon.cpp Fri Sep 10 15:56:20 2004
@@ -22,8 +22,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <readline/readline.h>
-#include <readline/history.h>
#include <ctype.h>
#include <string.h>
@@ -157,6 +155,8 @@
int level = 4;
int time = 12;
+ int llvm_index;
+
printf("Hexxagon board game.\n");
printf("Copyright 2001.\n");
printf("Erik Jonsson.\n");
@@ -167,11 +167,10 @@
char *input = 0;
- while(!quit)
+ for (llvm_index = 0; llvm_index < 1; llvm_index++)
{
- char *tmp = readline("Hexxagon (\"help\" for help):");
- stripFromDblSpace(tmp);
-
+ char * tmp = "newgame CC";
+
int len = strlen(tmp);
if(len && tmp[len - 1] == ' ')
tmp[len - 1] = 0;
@@ -180,11 +179,9 @@
{
if(input)
printf("Repeating last command.\n");
- free(tmp);
}
else
{
- free(input);
input = tmp;
}
@@ -431,6 +428,4 @@
else
printf("Unknown command, try \"help\" for a list of commands.\n");
}
-
- free(input);
}
More information about the llvm-commits
mailing list