Hello community,

here is the log from the commit of package hxtools for openSUSE:Factory checked 
in at 2015-03-25 10:01:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/hxtools (Old)
 and      /work/SRC/openSUSE:Factory/.hxtools.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "hxtools"

Changes:
--------
--- /work/SRC/openSUSE:Factory/hxtools/hxtools.changes  2015-02-22 
17:26:51.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.hxtools.new/hxtools.changes     2015-03-25 
10:01:15.000000000 +0100
@@ -1,0 +2,7 @@
+Wed Mar  4 16:24:12 UTC 2015 - jeng...@inai.de
+
+- Update to new upstream release 20150304
+* bin2c: improve coding efficiency of Ultra mode
+* bin2c: improve runtime by 30%
+
+-------------------------------------------------------------------

Old:
----
  hxtools-20150221.tar.asc
  hxtools-20150221.tar.xz

New:
----
  hxtools-20150304.tar.asc
  hxtools-20150304.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ hxtools.spec ++++++
--- /var/tmp/diff_new_pack.34UVhP/_old  2015-03-25 10:01:16.000000000 +0100
+++ /var/tmp/diff_new_pack.34UVhP/_new  2015-03-25 10:01:16.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           hxtools
-Version:        20150221
+Version:        20150304
 Release:        0
 Summary:        Collection of day-to-day tools (binaries)
 License:        GPL-2.0+ and WTFPL

++++++ hxtools-20150221.tar.xz -> hxtools-20150304.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hxtools-20150221/configure 
new/hxtools-20150304/configure
--- old/hxtools-20150221/configure      2015-02-21 10:29:24.000000000 +0100
+++ new/hxtools-20150304/configure      2015-03-04 17:24:13.000000000 +0100
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for hxtools 20150221.
+# Generated by GNU Autoconf 2.69 for hxtools 20150304.
 #
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -577,8 +577,8 @@
 # Identity of this package.
 PACKAGE_NAME='hxtools'
 PACKAGE_TARNAME='hxtools'
-PACKAGE_VERSION='20150221'
-PACKAGE_STRING='hxtools 20150221'
+PACKAGE_VERSION='20150304'
+PACKAGE_STRING='hxtools 20150304'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -1308,7 +1308,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures hxtools 20150221 to adapt to many kinds of systems.
+\`configure' configures hxtools 20150304 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1374,7 +1374,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of hxtools 20150221:";;
+     short | recursive ) echo "Configuration of hxtools 20150304:";;
    esac
   cat <<\_ACEOF
 
@@ -1494,7 +1494,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-hxtools configure 20150221
+hxtools configure 20150304
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2078,7 +2078,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by hxtools $as_me 20150221, which was
+It was created by hxtools $as_me 20150304, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2943,7 +2943,7 @@
 
 # Define the identity of the package.
  PACKAGE='hxtools'
- VERSION='20150221'
+ VERSION='20150304'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -6336,7 +6336,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by hxtools $as_me 20150221, which was
+This file was extended by hxtools $as_me 20150304, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -6402,7 +6402,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-hxtools config.status 20150221
+hxtools config.status 20150304
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hxtools-20150221/configure.ac 
new/hxtools-20150304/configure.ac
--- old/hxtools-20150221/configure.ac   2015-02-21 10:29:04.000000000 +0100
+++ new/hxtools-20150304/configure.ac   2015-03-04 17:24:01.000000000 +0100
@@ -1,4 +1,4 @@
-AC_INIT([hxtools], [20150221])
+AC_INIT([hxtools], [20150304])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_HEADERS([config.h])
 AC_PROG_INSTALL
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hxtools-20150221/doc/bin2c.1 
new/hxtools-20150304/doc/bin2c.1
--- old/hxtools-20150221/doc/bin2c.1    2015-02-21 10:29:04.000000000 +0100
+++ new/hxtools-20150304/doc/bin2c.1    2015-03-04 17:24:01.000000000 +0100
@@ -6,7 +6,8 @@
 .PP
 \fBbin2c\fP [\fB\-C\fP \fIprogram-file\fP] [\fB\-D\fP \fIdir_prefix\fP]
 [\fB\-H\fP \fIheader-file\fP] [\fB\-G\fP \fIguard-name\fP]
-[\fB\-p\fP \fInum\fP] [\fB\-v\fP] [\fB\-\-wxbitmap\fP] \fIfile\fP...
+[\fB\-p\fP \fInum\fP] [\fB\-v\fP] [\fB\-\-ultra\fP] [\fB\-\-wxbitmap\fP]
+\fIfile\fP...
 .SH Description
 .PP
 bin2c converts files to C variables. It does so by reading the contents of each
@@ -29,6 +30,9 @@
 .TP
 \fB\-D\fP \fIdir_prefix\fP
 All filenames on the command line will be prefixed with the given directory.
+This has the implication that files will be searched relative to
+\fIdir_prefix\fP, while the variable name ending up in the C source for an
+image will remain non-prefixed.
 .TP
 \fB\-G\fP \fIname\fP
 Request that an include guard by the identifier \fIguard-name\fP is emitted
@@ -50,8 +54,15 @@
 \fB\-v\fP
 Be verbose. Show all the names and filenames that bin2c will write.
 .TP
+\fB\-\-ultra\fP
+Writeout the raw data as a string literal. As the literal contains a trailing
+NUL byte, the size of the array is necessarily also one byte longer than the
+raw data, which you need to account for. (In C, it would be possible to write
+char x[3] = "ABC", but this leads to an error in C++ where x[4] is required.)
+.TP
 \fB\-\-wxbitmap\fP
-Generate C++ code that generates wxBitmap objects.
+Generate C++ code that generates wxBitmap objects. (Implies Ultra encoding,
+and deals with it appropriately, too.)
 .SH Examples
 .PP
 To generate a single C header file that behaves like XPM files and which is
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hxtools-20150221/sadmin/proc_stat_parse.c 
new/hxtools-20150304/sadmin/proc_stat_parse.c
--- old/hxtools-20150221/sadmin/proc_stat_parse.c       2015-02-21 
10:29:04.000000000 +0100
+++ new/hxtools-20150304/sadmin/proc_stat_parse.c       2015-03-04 
17:24:01.000000000 +0100
@@ -15,7 +15,7 @@
 #include <libHX/string.h>
 
 struct sp_task {
-       char comm[31], state;
+       char comm[32], state;
        int pid, ppid, pgid, sid, tty_nr, tty_pgrp;
        unsigned int task_flags;
        /*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hxtools-20150221/sdevel/bin2c.c 
new/hxtools-20150304/sdevel/bin2c.c
--- old/hxtools-20150221/sdevel/bin2c.c 2015-02-21 10:29:04.000000000 +0100
+++ new/hxtools-20150304/sdevel/bin2c.c 2015-03-04 17:24:01.000000000 +0100
@@ -1,6 +1,6 @@
 /*
  *     bin2c - convert arbitrary files into C variable definitions
- *     Copyright by Jan Engelhardt, 2004–2008,2013–2014
+ *     Copyright by Jan Engelhardt, 2004–2008,2013–2015
  *
  *     This program is free software; you can redistribute it and/or
  *     modify it under the terms of the GNU General Public License
@@ -54,41 +54,87 @@
 static hxmc_t *btc_cfile, *btc_hfile;
 static hxmc_t *btc_guard_name;
 static char *btc_prefix_directory;
-static unsigned int btc_verbose, btc_emit_wxbitmap;
-static const char btc_quote_needed[] = "\"?\\";
+static unsigned int btc_verbose, btc_emit_wxbitmap, btc_emit_ultra;
 static const struct btc_operations *btc_ops;
 static int btc_strip = -1;
 
-static size_t btc_qsize_cstring(const void *src, size_t input_size)
+static char *btc_tblquote(const void *vsrc, size_t input_size)
 {
-       const unsigned char *p = src;
-       size_t z = 0;
-
-       for (; input_size-- > 0; ++p)
-               z += (!HX_isprint(*p) ||
-                    strchr(btc_quote_needed, *p) != NULL) ?
-                    4 /* "\xXY" */ : 1;
-       return z;
-}
-
-static char *btc_memquote(const void *vsrc, size_t input_size)
-{
-       size_t quoted_size = btc_qsize_cstring(vsrc, input_size);
-       char *out = malloc(quoted_size + 1), *p = out;
        const unsigned char *src = vsrc;
+       size_t quoted_size = input_size * 5;
+       char *out, *p;
 
+       p = out = malloc(quoted_size + 1);
        if (out == NULL)
                abort();
        for (; input_size-- > 0; ++src) {
-               if (!HX_isprint(*src) ||
-                   strchr(btc_quote_needed, *src) != NULL) {
-                       *p++ = '\\';
-                       *p++ = '0' + ((*src & 0700) >> 6);
+               if (*src == 0) {
+                       *p++ = '0';
+               } else if (*src <= 07) {
+                       *p++ = '0';
+                       *p++ = '0' + (*src & 0007);
+               } else if (HX_isprint(*src) && *src != '\'' && *src != '\\') {
+                       *p++ = '\'';
+                       *p++ = *src;
+                       *p++ = '\'';
+               } else if (*src <= 077) {
+                       *p++ = '0';
                        *p++ = '0' + ((*src & 0070) >> 3);
                        *p++ = '0' + (*src & 0007);
                } else {
+                       *p++ = '0';
+                       *p++ = '0' + ((*src & 0700) >> 6);
+                       *p++ = '0' + ((*src & 0070) >> 3);
+                       *p++ = '0' + (*src & 0007);
+               }
+               *p++ = ',';
+       }
+       *p = '\0';
+       return out;
+}
+
+/*
+ * character/sequence          chance          expansion
+ * 00,22,5C                    3/256           2 (\x)
+ * 01..07,digit                        7/256*10/256    4 (\000 .. \007)
+ * 01..07,nondigit             7/256*246/256   2 (\0 .. \7)
+ * 08..1F,digit                        24/256*10/256   4 (\010 .. \031)
+ * 08..1F,nondigit             24/256*246/256  3 (\10 .. \31)
+ * 20..21,23..3E,40..5B,5D..7E 92/256          1
+ * 3F:3F                       1/256*1/256     3 (\077)
+ * 3F:!3F                      1/256*255/256   1 (?)
+ * 7F..FF                      129/256         4 (\177 .. \377)
+ * average bytes per byte around 2.74411 (the 3F cases are hard to determine)
+ */
+static char *btc_memquote(const void *vsrc, size_t input_size)
+{
+       size_t quoted_size = input_size * 4 + 1;
+       char *out, *p;
+       const unsigned char *src = vsrc;
+       bool qthis, qnext;
+
+       p = out = malloc(quoted_size + 1);
+       qnext = input_size > 1 && (src[0] == '\"' || src[0] == '\\' || 
!HX_isprint(src[0]));
+       for (; input_size-- > 0; ++src) {
+               qthis = qnext;
+               qnext = input_size > 0 && (!HX_isprint(src[1]) ||
+                       src[1] == '\"' || src[1] == '\\' ||
+                       (src[1] == '?' && src[0] == '?' && !qthis));
+               if (!qthis) {
+                       *p++ = *src;
+                       continue;
+               }
+               bool full = input_size == 0 || (!qnext && HX_isdigit(src[1]));
+               *p++ = '\\';
+               if (*src == '\"' || *src == '\\') {
                        *p++ = *src;
+                       continue;
                }
+               if (full || *src > 0070)
+                       *p++ = '0' + ((*src & 0700) >> 6);
+               if (full || *src > 0007)
+                       *p++ = '0' + ((*src & 0070) >> 3);
+               *p++ = '0' + (*src & 0007);
        }
        *p = '\0';
        return out;
@@ -124,12 +170,53 @@
        size_t input_len;
 
        fprintf(state->cfp, "/* Autogenerated from %s */\n", state->ifile);
+       if (state->cfp != state->hfp) {
+               fprintf(state->hfp, "extern const unsigned char bin2c_%s[%" 
HX_SIZET_FMT "u];\n",
+                       state->vname, state->isize);
+               fprintf(state->cfp, "const unsigned char bin2c_%s[%" 
HX_SIZET_FMT "u] = {",
+                       state->vname, state->isize);
+       } else {
+               fprintf(state->cfp,
+                       "static const unsigned char bin2c_%s[%" HX_SIZET_FMT 
"u] = {",
+                       state->vname, state->isize);
+       }
+
+       while ((input_len = fread(input_buf, 1, sizeof(input_buf),
+           state->ifp)) > 0)
+       {
+               output_buf = btc_tblquote(input_buf, input_len);
+               if (output_buf == NULL)
+                       abort();
+               fwrite(output_buf, strlen(output_buf), 1, state->cfp);
+               free(output_buf);
+       }
+       fprintf(state->cfp, "};\n");
+}
+
+static const struct btc_operations btc_stdc_ops = {
+       .global_header = btc_generic_global_header,
+       .global_footer = btc_generic_global_footer,
+       .file_content  = btc_stdc_file_content,
+};
+
+/**
+ * Output the binary stream as a string literal.
+ * "Ultra mode".
+ *
+ * C++ is very picky about sizes. "ABC" is of type char[4] and must be
+ * assigned to a char[N] with N >= 4. In C, "ABC" could be assigned to
+ * char[N] with N >= 3 too.
+ * Yes, this means the array contains a trailing \0 byte.
+ * You can either live with it (JPEG and PNG seem to permit trailing garbage),
+ * or substract 1 when using sizeof/ARRAY_SIZE.
+ */
+static void btc_ultra_file_content(struct btc_state *state)
+{
+       char input_buf[4096], *output_buf;
+       size_t input_len;
+
+       fprintf(state->cfp, "/* Autogenerated from %s */\n", state->ifile);
 
-       /*
-        * C++ is very picky about sizes. "ABC" is of type char[4] and must be
-        * assigned to a char[N] with N >= 4. In C, "ABC" could be assigned to
-        * char[N] with N >= 3 too.
-        */
        if (state->cfp != state->hfp) {
                fprintf(state->hfp, "extern const unsigned char bin2c_%s[%" 
HX_SIZET_FMT "u];\n",
                        state->vname, state->isize + 1);
@@ -153,10 +240,10 @@
        fprintf(state->cfp, "\";\n");
 }
 
-static const struct btc_operations btc_stdc_ops = {
+static const struct btc_operations btc_ultra_ops = {
        .global_header = btc_generic_global_header,
        .global_footer = btc_generic_global_footer,
-       .file_content  = btc_stdc_file_content,
+       .file_content  = btc_ultra_file_content,
 };
 
 static void btc_wxbitmap_global_header(struct btc_state *state)
@@ -399,6 +486,8 @@
         .help = "Be verbose during operation"},
        {.ln = "wxbitmap", .type = HXTYPE_NONE, .ptr = &btc_emit_wxbitmap,
         .help = "Generate wxBitmap variables rather than plain data"},
+       {.ln = "ultra", .type = HXTYPE_NONE, .ptr = &btc_emit_ultra,
+        .help = "Generate variables using +1-sized(!) string literals"},
        HXOPT_AUTOHELP,
        HXOPT_TABLEEND,
 };
@@ -537,7 +626,8 @@
                printf("Header guard name: %s\n",
                       (btc_guard_name != NULL) ? btc_guard_name : "");
        }
-       btc_ops = btc_emit_wxbitmap ? &btc_wxbitmap_ops : &btc_stdc_ops;
+       btc_ops = btc_emit_wxbitmap ? &btc_wxbitmap_ops :
+                 btc_emit_ultra ? &btc_ultra_ops : &btc_stdc_ops;
        return true;
 }
 

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to