Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libcurses/director if you don't include the proper...



details:   https://anonhg.NetBSD.org/src/rev/dfc9a6b3370a
branches:  trunk
changeset: 765015:dfc9a6b3370a
user:      christos <christos%NetBSD.org@localhost>
date:      Sun May 15 23:56:28 2011 +0000

description:
if you don't include the proper include files, you are going to end up
calling functions incorrectly.

diffstat:

 tests/lib/libcurses/director/director.c       |  6 +++++-
 tests/lib/libcurses/director/testlang_conf.l  |  3 ++-
 tests/lib/libcurses/director/testlang_parse.y |  8 ++++++--
 3 files changed, 13 insertions(+), 4 deletions(-)

diffs (82 lines):

diff -r fba8e75009f1 -r dfc9a6b3370a tests/lib/libcurses/director/director.c
--- a/tests/lib/libcurses/director/director.c   Sun May 15 23:43:56 2011 +0000
+++ b/tests/lib/libcurses/director/director.c   Sun May 15 23:56:28 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: director.c,v 1.3 2011/04/19 20:13:55 martin Exp $      */
+/*     $NetBSD: director.c,v 1.4 2011/05/15 23:56:28 christos Exp $    */
 
 /*-
  * Copyright 2009 Brett Lymn <blymn%NetBSD.org@localhost>
@@ -31,13 +31,17 @@
 
 #include <fcntl.h>
 #include <unistd.h>
+#include <ctype.h>
 #include <termios.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <util.h>
+#include <err.h>
 #include "returns.h"
 
+void yyparse(void);
 #define DEF_TERMPATH "."
 #define DEF_TERM "atf"
 #define DEF_SLAVE "./slave"
diff -r fba8e75009f1 -r dfc9a6b3370a tests/lib/libcurses/director/testlang_conf.l
--- a/tests/lib/libcurses/director/testlang_conf.l      Sun May 15 23:43:56 2011 +0000
+++ b/tests/lib/libcurses/director/testlang_conf.l      Sun May 15 23:56:28 2011 +0000
@@ -1,5 +1,5 @@
 %{
-/*     $NetBSD: testlang_conf.l,v 1.2 2011/04/11 09:03:24 blymn Exp $  */
+/*     $NetBSD: testlang_conf.l,v 1.3 2011/05/15 23:56:28 christos Exp $       */
 
 /*-
  * Copyright 2009 Brett Lymn <blymn%NetBSD.org@localhost>
@@ -31,6 +31,7 @@
  */
 
 #include <curses.h>
+#include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff -r fba8e75009f1 -r dfc9a6b3370a tests/lib/libcurses/director/testlang_parse.y
--- a/tests/lib/libcurses/director/testlang_parse.y     Sun May 15 23:43:56 2011 +0000
+++ b/tests/lib/libcurses/director/testlang_parse.y     Sun May 15 23:56:28 2011 +0000
@@ -1,5 +1,5 @@
 %{
-/*     $NetBSD: testlang_parse.y,v 1.2 2011/04/21 10:23:50 blymn Exp $ */
+/*     $NetBSD: testlang_parse.y,v 1.3 2011/05/15 23:56:28 christos Exp $      */
 
 /*-
  * Copyright 2009 Brett Lymn <blymn%NetBSD.org@localhost>
@@ -32,6 +32,8 @@
 #include <assert.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <err.h>
+#include <unistd.h>
 #include <poll.h>
 #include <stdbool.h>
 #include <stdio.h>
@@ -50,6 +52,8 @@
 extern char *check_path;
 extern char *cur_file;         /* from director.c */
 
+int yylex(void);
+
 size_t line;
 
 static int input_delay;
@@ -777,7 +781,7 @@
                         */
                        result = read(check_fd, &drain, 1);
                        if (result == -1)
-                               err("read of data file failed");
+                               err(1, "read of data file failed");
 
                        if (result > 0) {
                                fprintf(stderr, "Error: excess data "



Home | Main Index | Thread Index | Old Index