[Pkg-wmaker-commits] [wmpinboard] 02/30: some changes to get it to autoreconf

Doug Torrance dtorrance-guest at moszumanska.debian.org
Wed Jan 27 23:31:37 UTC 2016


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmpinboard.

commit 9f8eedcdf5c1e9e7eb84aadcc6ece6e8937d7bd5
Author: Brian Bidulock <bidulock at openss7.org>
Date:   Sun May 24 18:32:34 2015 -0600

    some changes to get it to autoreconf
---
 acconfig.h       |  12 -------
 configure.in     | 103 -------------------------------------------------------
 src/Makefile.am  |   5 +--
 src/wmpinboard.c |  48 +++++++++++++++++---------
 4 files changed, 34 insertions(+), 134 deletions(-)

diff --git a/acconfig.h b/acconfig.h
deleted file mode 100644
index 066d034..0000000
--- a/acconfig.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* define if the XPM library is available */
-#undef HAVE_LIBXPM
-
-/* define if there is an 8-bit-clean memcmp() */
-#undef HAVE_MEMCMP
-
-/* define the edit mode timeout in seconds (0 disables) */
-#undef TIMEOUT
-
-/* define if wear & tear of notes (creases) is to be simulated */
-#undef CREASES
-
diff --git a/configure.in b/configure.in
deleted file mode 100644
index 1e1a681..0000000
--- a/configure.in
+++ /dev/null
@@ -1,103 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-
-AC_INIT(configure.in)
-AM_INIT_AUTOMAKE(wmpinboard, 1.0)
-AM_CONFIG_HEADER(config.h)
-
-AC_PROG_CC
-dnl don't want the -g flag
-CFLAGS=`echo "x $CFLAGS"|sed 's/^x //; s/\(^\| \)-g\($\| \)/ /g'`
-AC_ISC_POSIX
-AC_LANG_C
-
-dnl use POSIX and BSD stuff where available
-CFLAGS="$CFLAGS -D_BSD_SOURCE -D_POSIX_SOURCE=199506L"
-
-dnl additional compile flags when using gcc
-if test x$GCC = xyes; then
-  CFLAGS="$CFLAGS -Wall -ansi -pedantic"
-fi
-
-dnl X11 stuff
-AC_PATH_XTRA
-AC_CHECK_LIB(Xpm, main, AC_DEFINE(HAVE_LIBXPM),
-  AC_MSG_ERROR(The XPM library is required but wasn't found.),
-  $X_LIBS -lX11 -lXext)
-
-AC_CHECK_LIB(ife, sense)
-
-AC_C_CONST
-AC_C_INLINE
-dnl check for C headers and functions
-dnl more or less optional ones first
-AC_CHECK_HEADERS([getopt.h malloc.h signal.h string.h unistd.h])
-AC_CHECK_FUNC(getopt, , need_getopt=yes)
-AC_CHECK_FUNC(getopt_long, , need_getopt_long=yes)
-AC_FUNC_MEMCMP
-if test x"$ac_cv_func_memcmp_clean" = xyes; then
-  AC_DEFINE(HAVE_MEMCMP)
-else
-  need_memcmp=yes
-fi
-dnl required ones
-AC_CHECK_FUNC(strchr, ,
-  AC_MSG_ERROR(Your C library seems to be lacking the strchr() function.))
-AC_CHECK_FUNC(strcasecmp, ,
-  AC_MSG_ERROR(Your C library seems to be lacking the strcasecmp() function.))
-AC_CHECK_FUNC(ualarm, ,
-  AC_MSG_ERROR(Your C library seems to be lacking the ualarm() function.))
-AC_CHECK_FUNC(usleep, ,
-  AC_MSG_ERROR(Your C library seems to be lacking the usleep() function.))
-AC_CHECK_FUNC(kill, ,
-  AC_MSG_ERROR(Your C library seems to be lacking the kill() function.))
-
-dnl === compile-time options ===
-dnl TIMEOUT
-AC_ARG_ENABLE(timeout,
-[  --enable-timeout[=TIME] set edit mode timeout to TIME seconds (default = 60)],
-[case "${enableval}" in
-	yes)	timeout=60 ;;
-	no)		timeout=0 ;;
-	*)		timeout=`echo "${enableval}"|sed 's/[^0-9]//g'`
-			if test x"$timeout" = x; then
-				AC_MSG_ERROR(Bad value ${enableval} for --enable-timeout.)
-			fi
-			if test $timeout -gt 0 -a $timeout -lt 5; then
-				timeout=5
-				AC_MSG_WARN(Timeout value to low: increasing to 5 seconds.)
-			fi
-			;;
-esac], [timeout=60])
-AC_DEFINE_UNQUOTED(TIMEOUT, ${timeout})
-
-dnl CREASES
-AC_ARG_ENABLE(creases,
-[  --enable-creases        enable wear and tear (creases) (default = yes)],
-[case "${enableval}" in
-	yes)	creases=yes ;;
-	no)		creases=no ;;
-	*)		AC_MSG_ERROR(Bad value ${enableval} for --enable-creases.) ;;
-esac], [creases=yes])
-if test x"$creases" = xyes; then
-  AC_DEFINE(CREASES)
-fi
-
-dnl determine what conditional stuff has to be compiled
-if test x"$need_memcmp" = xyes; then
-  CONDITIONAL_SOURCES="$CONDITIONAL_SOURCES memcmp.c"
-fi
-if test x"$need_getopt" = xyes; then
-  CONDITIONAL_SOURCES="$CONDITIONAL_SOURCES getopt.c"
-fi
-if test x"$need_getopt_long" = xyes; then
-  CONDITIONAL_SOURCES="$CONDITIONAL_SOURCES getopt1.c"
-fi
-AC_SUBST(CONDITIONAL_SOURCES)
-
-AC_OUTPUT([
-Makefile
-src/Makefile
-man/Makefile
-wmpinboard.spec
-])
-
diff --git a/src/Makefile.am b/src/Makefile.am
index 24841fe..88c924d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,15 +1,16 @@
 ## Process this file with automake to produce Makefile.in
 
-INCLUDES = $(X_CFLAGS)
+AM_CPPFLAGS = $(X_CFLAGS)
 LIBS = $(X_LIBS) -lX11 -lXext -lXpm
 
 bin_PROGRAMS = wmpinboard
 
-wmpinboard_SOURCES = @CONDITIONAL_SOURCES@ \
+wmpinboard_SOURCES = memcmp.c \
 	misc.c misc.h \
 	notes.c notes.h \
 	wmpinboard.c wmpinboard.h \
 	xmisc.c xmisc.h
+wmpinboard_CFLAGS = -g
 
 EXTRA_wmpinboard_SOURCES = \
 	getopt.c getopt1.c getopt.h \
diff --git a/src/wmpinboard.c b/src/wmpinboard.c
index c1a6235..800457b 100644
--- a/src/wmpinboard.c
+++ b/src/wmpinboard.c
@@ -165,7 +165,7 @@ notes_io(int save)
   char t[STRING_BUF_SIZE];
   FILE *file;
   int pid = (int) getpid();
-  static int sizes[6];
+  static int sizes[7];
   sizes[0] = size_0;
   sizes[1] = size_1;
   sizes[2] = size_2;
@@ -973,26 +973,32 @@ parse_argv(int argc, char **argv)
       case 'h': help();
       case 'i': action(M_INFO, 0);
       case 'v':
-        printf("wmpinboard v" VERSION "\n\ncompile-time configuration:\n"
-          "  - maximal number of notes is %d\n"
 #if TIMEOUT == 0
-          "  - edit mode timeout is disabled by default\n"
+#define PRINT1    "  - edit mode timeout is disabled by default\n"
 #else
-          "  - default edit mode timeout is %d seconds\n"
+#define PRINT1    "  - default edit mode timeout is %d seconds\n"
 #endif
-          "  - wear & tear of notes (creases) is "
 #ifdef CREASES
-          "enabled\n"
+#define PRINT2    "enabled\n"
 #else
-          "disabled\n"
+#define PRINT2    "disabled\n"
 #endif
 #ifndef FUNSTUFF
-          "  - FUNSTUFF is disabled  :-/\n"
+#define PRINT3    "  - FUNSTUFF is disabled  :-/\n"
+#else
+#define PRINT3
 #endif
-          , MAX_NOTES
 #if TIMEOUT != 0
-          , TIMEOUT
+#define PRINT4    , TIMEOUT
 #endif
+        printf("wmpinboard v" VERSION "\n\ncompile-time configuration:\n"
+          "  - maximal number of notes is %d\n"
+	  PRINT1
+          "  - wear & tear of notes (creases) is "
+          PRINT2
+          PRINT3
+          , MAX_NOTES
+          PRINT4
           );
         exit(EXIT_SUCCESS);
       default : exit(EXIT_FAILURE);
@@ -1532,7 +1538,7 @@ handle_ButtonRelease(XEvent *event)
         }
       } else {  /* moved */
         if (state.cur_note >= 0) {
-          if (string_empty(ndata[state.cur_note].text, 0)) {  /* new note */
+          if (note_empty(state.cur_note)) {  /* new note */
             animate_note(4);
             set_kbfocus(1);
             set_mode(M_EDIT);
@@ -1711,7 +1717,14 @@ handle_ButtonRelease(XEvent *event)
         {
           if (state.abar_pressed < 4) {  /* clicked on number */
             char c = state.a_edit[state.abar_pressed];
-            char delta = state.button == 1 ? 1 : -1;
+            char delta;
+            switch (state.button) {
+              case 1:  delta = 1;   break;  /* Left mouse button */
+              case 3:  delta = -1;  break;  /* Right mouse button */
+              case 4:  delta = 1;   break;  /* Scrollwheel up */
+              case 5:  delta = -1;  break;  /* Scrollwheel down */
+              default: delta = 0;   break;  /* Unknown button; ignore */
+            }
 
             switch (state.abar_pressed) {
               case 0:  c = (24+c+delta)%24;  break;
@@ -1849,7 +1862,7 @@ void
 handle_KeyPress(XEvent *event)
 {
   KeySym ksym;
-  unsigned char ch[4];
+  char ch[4];
   char *s;
   int i, j = 0;
 
@@ -1910,8 +1923,9 @@ handle_KeyPress(XEvent *event)
     }
   } else {
     if (InputContext) {
-      j = XmbLookupString(InputContext, &event->xkey, (char*) ch, sizeof(ch),
-        &ksym, 0);
+      Status status_return;
+      j = XmbLookupString(InputContext, &event->xkey, ch, sizeof(ch),
+        &ksym, &status_return);
     } else {
       j = XLookupString(&event->xkey, (char*) ch, sizeof(ch), &ksym,
         &state.compose);
@@ -2120,7 +2134,7 @@ main(int argc, char **argv)
   init();                  /* initialize X window */
   XSetCommand(display, mainwin, argv, argc);
   XMapWindow(display, mainwin);
-  init_xlocale();          /* initialize input context */
+/*  init_xlocale();          /* initialize input context */
 
   /* initialize internal images, palette, cursors */
   bbar = get_xpm((char**) bbar_xpm);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmpinboard.git



More information about the Pkg-wmaker-commits mailing list