aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2012-10-11 14:31:49 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2012-10-11 14:31:49 +0300
commitdfa58f8b8ebf024c2ec678a836adcd055e4bc052 (patch)
tree18d3fba3a482ad31ce77d6de1990d67ab93b54db /lib
parent242dd0a45ec3c7db7715d5dec327bad6d17e86a1 (diff)
downloadeclat-dfa58f8b8ebf024c2ec678a836adcd055e4bc052.tar.gz
eclat-dfa58f8b8ebf024c2ec678a836adcd055e4bc052.tar.bz2
Trivial fixes.
Diffstat (limited to 'lib')
-rw-r--r--lib/diag.c2
-rw-r--r--lib/filemap.c1
-rw-r--r--lib/forlan.c13
-rw-r--r--lib/forlangrm.y6
-rw-r--r--lib/forlanlex.l1
-rw-r--r--lib/ldapmap.c8
-rw-r--r--lib/libeclat.h4
-rw-r--r--lib/map.c1
-rw-r--r--lib/reqsign.c4
-rw-r--r--lib/urlencode.c4
-rw-r--r--lib/xmltree.c22
11 files changed, 16 insertions, 50 deletions
diff --git a/lib/diag.c b/lib/diag.c
index 5386abd..0e44491 100644
--- a/lib/diag.c
+++ b/lib/diag.c
@@ -40,8 +40,6 @@ vdiag(grecs_locus_t const *locus, const char *qual, const char *fmt,
fprintf(stderr, "%s: ", program_name);
if (locus) {
- size_t size = 0;
-
if (locus->beg.col == 0)
fprintf(stderr, "%s:%u",
locus->beg.file,
diff --git a/lib/filemap.c b/lib/filemap.c
index f1d726b..c43ba35 100644
--- a/lib/filemap.c
+++ b/lib/filemap.c
@@ -58,7 +58,6 @@ filemap_config(int dbg, struct grecs_node *node, void *data)
{
struct filemap *filemap, **return_filemap = data;
int i;
- const char *filename;
struct grecs_node *p;
filemap = grecs_malloc(sizeof(*filemap));
diff --git a/lib/forlan.c b/lib/forlan.c
index f1d49d7..e86189b 100644
--- a/lib/forlan.c
+++ b/lib/forlan.c
@@ -17,6 +17,7 @@
#include "libeclat.h"
#include <string.h>
#include <setjmp.h>
+#include <ctype.h>
#include "grecs.h"
#include "forlan.h"
@@ -321,7 +322,7 @@ eval_comp0(forlan_eval_env_t env, union forlan_node *p)
if (p->comp.root) {
forlan_eval(env, p->comp.root);
if (!retval_boolean(env))
- return;
+ return NULL;
coerce_retval(env, 'n');
root = env->retval.v.node;
} else
@@ -465,8 +466,6 @@ dump_stmt(FILE *fp, union forlan_node *p, int *num, int lev)
void
eval_stmt(forlan_eval_env_t env, union forlan_node *node)
{
- union forlan_node *np;
-
while (node && node->type == forlan_type_stmt) {
forlan_eval(env, node->stmt.stmt);
node = node->stmt.next;
@@ -637,9 +636,9 @@ dump_loop(FILE *fp, union forlan_node *p, int *num, int lev)
fprintf(fp, "LOOP %lu\n", (unsigned long) p->loop.idx);
fprintf(fp, "%04d: %*.*sEXPR\n", ++*num, lev, lev, "");
forlan_dump_node(fp, p->loop.node, num, lev + 1);
- fprintf(fp, "%04d: %*.*sSTMT %lu\n", ++*num, lev, lev, "", n);
+ fprintf(fp, "%04d: %*.*sSTMT %d\n", ++*num, lev, lev, "", n);
forlan_dump_node(fp, p->loop.stmt, num, lev + 1);
- fprintf(fp, "%04d: %*.*sEND LOOP %lu\n", ++*num, lev, lev, "", n);
+ fprintf(fp, "%04d: %*.*sEND LOOP %d\n", ++*num, lev, lev, "", n);
}
void
@@ -897,8 +896,8 @@ func_decode(forlan_eval_env_t env, struct grecs_list *list)
if (!*p)
break;
ilen = strcspn(p, " \t\f\n");
- eclat_base64_decode(p, ilen, &optr, &olen);
- grecs_txtacc_grow(acc, optr, olen);
+ eclat_base64_decode((unsigned char*) p, ilen, &optr, &olen);
+ grecs_txtacc_grow(acc, (char*)optr, olen);
free(optr);
p += ilen;
diff --git a/lib/forlangrm.y b/lib/forlangrm.y
index 5c91f1a..4d77df6 100644
--- a/lib/forlangrm.y
+++ b/lib/forlangrm.y
@@ -20,6 +20,7 @@
#include <grecs-locus.h>
#include "forlangrm.h"
#include "forlan.h"
+#include <string.h>
static int yyerror(char *);
union forlan_node *forlan_parse_tree;
@@ -36,11 +37,6 @@ struct path_component {
char *label;
};
-static void
-free_comp(void *p)
-{
- free(p);
-}
%}
%error-verbose
%locations
diff --git a/lib/forlanlex.l b/lib/forlanlex.l
index 8df6d80..1eecf93 100644
--- a/lib/forlanlex.l
+++ b/lib/forlanlex.l
@@ -17,6 +17,7 @@
#include "libeclat.h"
#include <sysexits.h>
+#include <ctype.h>
#include <grecs.h>
#include <grecs-locus.h>
#include "forlangrm.h"
diff --git a/lib/ldapmap.c b/lib/ldapmap.c
index 1f08179..4e780af 100644
--- a/lib/ldapmap.c
+++ b/lib/ldapmap.c
@@ -69,8 +69,6 @@ cb_tls(enum grecs_callback_command cmd,
return 0;
}
-static char *typestr;
-
static struct grecs_keyword ldapmap_kw[] = {
{ "type", "'ldap", "Set map type", grecs_type_null },
{ "key", "<arg: string>", "key expression", grecs_type_null },
@@ -248,7 +246,6 @@ parse_ldap_uri(const char *uri)
for (ludp = &ludlist; *ludp; ) {
LDAPURLDesc *lud = *ludp;
- char **tmp;
if (lud->lud_dn && lud->lud_dn[0]
&& (lud->lud_host == NULL || lud->lud_host[0] == '\0')) {
@@ -287,8 +284,6 @@ ldap_connect(int dbg, struct ldap_map *map)
char *ldapuri = NULL;
LDAP *ld = NULL;
int protocol = LDAP_VERSION3;
- char *val;
- unsigned long lval;
if (map->dbg) {
if (ber_set_option(NULL, LBER_OPT_DEBUG_LEVEL, &map->dbg)
@@ -365,7 +360,6 @@ ldap_bind(int dbg, struct ldap_map *map)
char *info = NULL;
char **refs = NULL;
struct berval passwd;
- char *binddn;
msgbuf[0] = 0;
@@ -446,7 +440,6 @@ ldap_map_open(int dbg, void *data)
struct ldap_map *map = data;
char *user = NULL, *p;
uid_t uid = getuid();
- int i = 0;
struct passwd *pw;
const char *kw[3];
@@ -574,7 +567,6 @@ ldap_map_get(int dbg, void *data, const char *key, char **return_value)
char *attrs[2];
char **ret;
const char *kwe[3];
- struct wordsplit ws;
char *filter;
kwe[0] = "key";
diff --git a/lib/libeclat.h b/lib/libeclat.h
index 4a205a1..0843fb1 100644
--- a/lib/libeclat.h
+++ b/lib/libeclat.h
@@ -85,8 +85,10 @@ struct ec2_query {
struct ec2_query *eclat_query_create(int flags, const char *endpoint,
const char *uri);
void eclat_query_free(struct ec2_query *);
+void eclat_query_add_param(struct ec2_query *q, const char *name,
+ const char *value);
-int eclat_query_signature(struct ec2_query *req, char *secret);
+void eclat_query_signature(struct ec2_query *req, char *secret);
char *eclat_query_to_url(struct ec2_query *req, char **post_params);
diff --git a/lib/map.c b/lib/map.c
index f723cd9..461ead0 100644
--- a/lib/map.c
+++ b/lib/map.c
@@ -71,7 +71,6 @@ drv_copy(void *a, void *b)
int
eclat_map_drv_register(struct eclat_map_drv *drv)
{
- struct eclat_map_drv *p;
int install;
if (!mapdrv_symtab) {
diff --git a/lib/reqsign.c b/lib/reqsign.c
index 20c56a7..cee389d 100644
--- a/lib/reqsign.c
+++ b/lib/reqsign.c
@@ -42,7 +42,7 @@ compnames(const void *a, const void *b)
return strcmp(*ac, *bc);
}
-int
+void
eclat_query_signature(struct ec2_query *req, char *secret)
{
char **pnames;
@@ -104,7 +104,7 @@ eclat_query_signature(struct ec2_query *req, char *secret)
hmac_sha1(str, strlen(str), secret, strlen(secret), digest);
- eclat_base64_encode(digest, sizeof(digest),
+ eclat_base64_encode((unsigned char *)digest, sizeof(digest),
(unsigned char**) &req->signature, &siglen);
grecs_txtacc_free(acc);
diff --git a/lib/urlencode.c b/lib/urlencode.c
index a9cd68c..278a097 100644
--- a/lib/urlencode.c
+++ b/lib/urlencode.c
@@ -46,7 +46,7 @@ urlencode(const char *input, size_t len, char **poutput, size_t *poutlen)
outlen = len;
for (i = 0; i < len; i++)
- if (!prtch[input[i]])
+ if (!prtch[(unsigned char)input[i]])
outlen += 2;
if (poutlen)
@@ -56,7 +56,7 @@ urlencode(const char *input, size_t len, char **poutput, size_t *poutlen)
*poutput = output;
for (i = 0; i < len; i++) {
- if (prtch[input[i]])
+ if (prtch[(unsigned char)input[i]])
*output++ = input[i];
else {
*output++ = '%';
diff --git a/lib/xmltree.c b/lib/xmltree.c
index 6431d28..96a4d0a 100644
--- a/lib/xmltree.c
+++ b/lib/xmltree.c
@@ -16,6 +16,7 @@
#include <config.h>
#include "libeclat.h"
+#include <ctype.h>
#define NODEREF_TEXT 0x01 /* Text is being constructed */
@@ -65,27 +66,6 @@ eclat_partial_tree_finish(struct eclat_partial_tree *pt)
}
-static char *
-install_text(struct eclat_partial_tree *nref, const char *str)
-{
- struct grecs_syment key;
- struct grecs_syment *ent;
- int install = 1;
-
- if (!nref->texttab) {
- nref->texttab = grecs_symtab_create_default(
- sizeof(struct grecs_syment));
- if (!nref->texttab)
- grecs_alloc_die();
- }
-
- key.name = (char*) str;
- ent = grecs_symtab_lookup_or_install(nref->texttab, &key, &install);
- if (!ent)
- grecs_alloc_die();
- return ent->name;
-}
-
static struct grecs_node *
gettos(struct eclat_partial_tree *nref)
{

Return to:

Send suggestions and report system problems to the System administrator.