[Pkg-wmaker-commits] [wmstickynotes] 62/81: Add patches from Doug Torrance <dtorrance at monmouthcollege.edu> to fix the icon window size and to add some failure checks.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Tue Aug 25 02:33:52 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository wmstickynotes.
commit fe7e3aa9009bb3408c4c70b27e86007a6add2ec3
Author: hnc <hnc at 7fc852e4-12a7-4f5b-bad7-374d67da4d19>
Date: Wed May 27 22:34:03 2015 +0000
Add patches from Doug Torrance <dtorrance at monmouthcollege.edu> to fix the icon window size and to add some failure checks.
git-svn-id: svn://svn.code.sf.net/p/wmstickynotes/code@20 7fc852e4-12a7-4f5b-bad7-374d67da4d19
---
ChangeLog | 8 ++++++++
THANKS | 4 ++++
configure.ac | 17 ++++++++++++++---
wmstickynotes.c | 21 +++++++++++++++------
4 files changed, 41 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ff71be1..473cec0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-05-27 Heath Caldwell <hncaldwell at fastmail.com>
+ * Release wmstickynotes-0.5.
+ * Fixed size of icon window to 48x48 so that it works better with
+ Window Maker (patch from Doug Torrance
+ <dtorrance at monmouthcollege.edu>).
+ * Added some failure checks (patch from Doug Torrance
+ <dtorrance at monmouthcollege.edu>).
+
2014-12-05 Heath Caldwell <hncaldwell at fastmail.com>
* Release wmstickynotes-0.3.
* Fixed wmhints for icon window (patch from Moritz <thinksilicon at users.sf.net>).
diff --git a/THANKS b/THANKS
index 21e4e30..3b29822 100644
--- a/THANKS
+++ b/THANKS
@@ -7,3 +7,7 @@ for not storing the notes.
Thanks to Moritz <thinksilicon at users.sf.net> for a patch to properly set the
wmhints for the icon window.
+
+Thanks to Doug Torrance <dtorrance at monmouthcollege.edu> for patches to fix the
+icon window size and to add some failure checks.
+
diff --git a/configure.ac b/configure.ac
index c8a5f9d..b29bd89 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@
# Heath Caldwell <hncaldwell at fastmail.com>
#
-AC_INIT([wmstickynotes], [0.4], [Heath Caldwell <hncaldwell at fastmail.com>])
+AC_INIT([wmstickynotes],[0.5],[Heath Caldwell <hncaldwell at fastmail.com>])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADER([config.h])
@@ -13,7 +13,7 @@ AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
-AC_LANG_C
+AC_LANG([C])
AC_PATH_XTRA
AC_HEADER_DIRENT
AC_HEADER_STDC
@@ -29,7 +29,18 @@ AC_HEADER_TIME
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
-AC_TYPE_SIGNAL
+AC_DIAGNOSE([obsolete],[your code may safely assume C89 semantics that RETSIGTYPE is void.
+Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.])dnl
+AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE(
+[AC_LANG_PROGRAM([#include <sys/types.h>
+#include <signal.h>
+],
+ [return *(signal (0, 0)) (0) == 1;])],
+ [ac_cv_type_signal=int],
+ [ac_cv_type_signal=void])])
+AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers
+ (`int' or `void').])
+
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([mkdir])
diff --git a/wmstickynotes.c b/wmstickynotes.c
index 40a505a..c1156f7 100644
--- a/wmstickynotes.c
+++ b/wmstickynotes.c
@@ -141,7 +141,7 @@ int main(int argc, char *argv[])
colormap = gdk_colormap_new(gdk_visual_get_system(), TRUE);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- gtk_window_set_default_size(GTK_WINDOW(window), 64, 64);
+ gtk_window_set_default_size(GTK_WINDOW(window), 48, 48);
box = gtk_event_box_new();
gtk_container_add(GTK_CONTAINER (window), box);
@@ -404,7 +404,8 @@ void read_old_notes()
note = malloc(sizeof(Note));
if(!note) {
- fprintf(stderr, "Failed to allocate note for %s.\n", entry->d_name);
+ fprintf(stderr, "Failed to allocate note for '%s'.\n",
+ entry->d_name);
continue;
}
@@ -412,12 +413,20 @@ void read_old_notes()
note->id = atoi(entry->d_name);
if(note->id > highest_note_id) highest_note_id = note->id;
- fscanf(file, "%d,%d,%d,%d,%d,%d,",
- &(note->x), &(note->y), &(note->width), &(note->height),
- &reserved1, &reserved2);
+ if(fscanf(file, "%d,%d,%d,%d,%d,%d,",
+ &(note->x), &(note->y), &(note->width),
+ &(note->height), &reserved1, &reserved2) < 6) {
+ fprintf(stderr, "Failed to parse note '%s': "
+ "too few values.", entry->d_name);
+ continue;
+ }
/* Get color name */
- fgets(buffer, 256, file);
+ if(fgets(buffer, 256, file) == NULL) {
+ fprintf(stderr, "Failed to get color from note '%s'.",
+ entry->d_name);
+ continue;
+ }
/* Replace the newline with a null char */
buffer[strlen(buffer) - 1] = '\0';
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmstickynotes.git
More information about the Pkg-wmaker-commits
mailing list