aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2018-09-25 16:43:35 +0300
committerSergey Poznyakoff <gray@gnu.org>2018-09-25 16:43:35 +0300
commit4d441e3be04af215601858c32ff4df193ee30946 (patch)
tree5c42a4d5e79870e360dbc0aeb403443d886e7122
parentd85cc853175ebe65f9decae1fa34b7c5b4ef47d2 (diff)
downloaddico-4d441e3be04af215601858c32ff4df193ee30946.tar.gz
dico-4d441e3be04af215601858c32ff4df193ee30946.tar.bz2
Minor fixes
* configure.boot: Move check for libz to the proper file. * modules/dict.org/Makefile.am (dictorg_la_LIBADD): Link with -lz unconditionally. * modules/dict.org/dictorg.h: Use libz unconditionally. * modules/dict.org/dictstr.c: Likewise. * modules/dict.org/module.ac: Require libz and zlib.h * modules/guile/guile.c: Remove unused variable.
-rw-r--r--configure.boot7
-rw-r--r--modules/dict.org/Makefile.am2
-rw-r--r--modules/dict.org/dictorg.h4
-rw-r--r--modules/dict.org/dictstr.c20
-rw-r--r--modules/dict.org/module.ac9
-rw-r--r--modules/guile/guile.c4
6 files changed, 12 insertions, 34 deletions
diff --git a/configure.boot b/configure.boot
index 2513cf4..0d6f01e 100644
--- a/configure.boot
+++ b/configure.boot
@@ -117,13 +117,6 @@ AM_GNU_GETTEXT([external], [need-formatstring-macros])
AM_GNU_GETTEXT_VERSION([0.18])
AC_CONFIG_LINKS(include/gettext.h:gnu/gettext.h)
-# Check for zlib
-AC_CHECK_HEADER(zlib.h,
- AC_CHECK_LIB(z, inflate,
- [AC_DEFINE_UNQUOTED([USE_LIBZ], 1,
- [Define this if you have libz library])
- AC_SUBST(LIBZ, -lz)]))
-
LOG_FACILITY="LOG_DAEMON"
AC_ARG_VAR([LOG_FACILITY],
diff --git a/modules/dict.org/Makefile.am b/modules/dict.org/Makefile.am
index 339a7ab..d077a0c 100644
--- a/modules/dict.org/Makefile.am
+++ b/modules/dict.org/Makefile.am
@@ -27,7 +27,7 @@ dictorg_la_SOURCES = \
noinst_HEADERS = \
crc.h\
dictorg.h
-dictorg_la_LIBADD = ../../lib/libdico.la @LIBZ@
+dictorg_la_LIBADD = ../../lib/libdico.la -lz
AM_LDFLAGS = -module -avoid-version -no-undefined
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
EXTRA_DIST=module.ac
diff --git a/modules/dict.org/dictorg.h b/modules/dict.org/dictorg.h
index c12fad1..db17014 100644
--- a/modules/dict.org/dictorg.h
+++ b/modules/dict.org/dictorg.h
@@ -26,9 +26,7 @@
#include <errno.h>
#include <unistd.h>
#include <string.h>
-#ifdef USE_LIBZ
-# include <zlib.h>
-#endif
+#include <zlib.h>
#include <appi18n.h>
#define DICTORG_ENTRY_PREFIX "00-database"
diff --git a/modules/dict.org/dictstr.c b/modules/dict.org/dictstr.c
index b7bfd1a..5f004c7 100644
--- a/modules/dict.org/dictstr.c
+++ b/modules/dict.org/dictstr.c
@@ -39,7 +39,6 @@ struct _dict_stream {
int type; /* Stream type (see DICTORG_ constants) */
dico_stream_t transport; /* Underlying transport stream */
int transport_error; /* Last error on transport stream */
-#ifdef USE_LIBZ
/* Gzip/dict.org header */
size_t header_length; /* Header length. */
int method; /* Compression method */
@@ -66,11 +65,9 @@ struct _dict_stream {
size_t cache_size; /* Max. number of elements in cache */
size_t cache_used; /* Actual number of elements in cache */
struct _dict_chunk_cache **cache; /**/
-#endif
};
-#ifdef USE_LIBZ
static struct _dict_chunk_cache *
cache_create_chunk(struct _dict_stream *str)
{
@@ -270,23 +267,6 @@ _dict_seek_dzip(struct _dict_stream *str, off_t needle, int whence,
*presult = str->offset = offset;
return 0;
}
-
-#else
-# define cache_destroy(s)
-static int
-_dict_read_dzip(struct _dict_stream *str, char *buf, size_t size, size_t *pret)
-{
- return DE_UNSUPPORTED_FORMAT;
-}
-
-static int
-_dict_seek_dzip(struct _dict_stream *str, off_t needle, int whence,
- off_t *presult)
-{
- return DE_UNSUPPORTED_FORMAT;
-}
-
-#endif
static int
diff --git a/modules/dict.org/module.ac b/modules/dict.org/module.ac
index b80bc19..812ec1f 100644
--- a/modules/dict.org/module.ac
+++ b/modules/dict.org/module.ac
@@ -1,2 +1,9 @@
## module name: dictorg
-AC_CONFIG_FILES([modules/dict.org/tests/db/Makefile]) \ No newline at end of file
+AC_CONFIG_FILES([modules/dict.org/tests/db/Makefile])
+
+# Check for zlib
+AC_CHECK_HEADER(zlib.h,,
+ [AC_MSG_ERROR([required header zlib.h not found])])
+AC_CHECK_LIB(z, inflate,,
+ [AC_MSG_ERROR([required library libz not found])])
+
diff --git a/modules/guile/guile.c b/modules/guile/guile.c
index 0063a98..e250219 100644
--- a/modules/guile/guile.c
+++ b/modules/guile/guile.c
@@ -285,8 +285,8 @@ _make_strategy(const dico_strategy_t strat)
static size_t
_guile_strategy_free(SCM message_smob)
{
- struct _guile_strategy *sp =
- (struct _guile_strategy *) SCM_CDR (message_smob);
+ /* Nothing to free in struct _guile_strategy: the strat member is
+ constant */
return 0;
}

Return to:

Send suggestions and report system problems to the System administrator.