portability of header file.

git-svn-id: file:///svn/unbound/trunk@818 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2007-12-07 14:07:38 +00:00
parent 060d4740c2
commit 61b42edaef
4 changed files with 9 additions and 9 deletions

View file

@ -5,6 +5,7 @@
- dot removed from CNAME display.
- respect -v for NXDOMAINs.
- updated ldns-src.tar.gz with ldns-trunk today (1.2.2 fixes).
- size_t to int for portability of the header file.
6 December 2007: Wouter
- library resolution works in foreground mode, unbound-host app

View file

@ -91,7 +91,6 @@
*/
#ifndef _UB_UNBOUND_H
#define _UB_UNBOUND_H
#include <stdlib.h>
/**
* The validation context is created to hold the resolver status,
@ -124,7 +123,7 @@ struct ub_val_result {
char** data;
/** the length in bytes of the data items, len[i] for data[i] */
size_t* len;
int* len;
/**
* canonical name for the result (the final cname).

View file

@ -229,8 +229,8 @@ fill_res(struct ub_val_result* res, struct ub_packed_rrset_key* answer,
if(!fill_canon(res, finalcname))
return 0; /* out of memory */
}
res->data = calloc(1, sizeof(char*));
res->len = calloc(1, sizeof(size_t));
res->data = (char**)calloc(1, sizeof(char*));
res->len = (int*)calloc(1, sizeof(int));
return (res->data && res->len);
}
data = (struct packed_rrset_data*)answer->entry.data;
@ -239,13 +239,13 @@ fill_res(struct ub_val_result* res, struct ub_packed_rrset_key* answer,
return 0; /* out of memory */
} else
res->canonname = res->qname;
res->data = calloc(data->count+1, sizeof(char*));
res->len = calloc(data->count+1, sizeof(size_t));
res->data = (char**)calloc(data->count+1, sizeof(char*));
res->len = (int*)calloc(data->count+1, sizeof(int));
if(!res->data || !res->len)
return 0; /* out of memory */
for(i=0; i<data->count; i++) {
/* remove rdlength from rdata */
res->len[i] = data->rr_len[i] - 2;
res->len[i] = (int)(data->rr_len[i] - 2);
res->data[i] = memdup(data->rr_data[i]+2, res->len[i]);
if(!res->data[i])
return 0; /* out of memory */

View file

@ -220,7 +220,7 @@ static void
print_rd(int t, char* data, size_t len)
{
size_t i, pos = 0;
uint8_t* rd = malloc(len+2);
uint8_t* rd = (uint8_t*)malloc(len+2);
ldns_rr* rr = ldns_rr_new();
ldns_status status;
if(!rd || !rr) {
@ -326,7 +326,7 @@ pretty_output(char* q, int t, int c, int sec, int haved,
pretty_rdata(
result->canonname?result->canonname:q,
cstr, tstr, t, secstatus, result->data[i],
result->len[i]);
(size_t)result->len[i]);
i++;
}
}