Browse Source

Minor char and void changes

master
Con Kolivas 11 years ago
parent
commit
2a78efc3ef
  1. 12
      src/libckpool.c
  2. 10
      src/libckpool.h

12
src/libckpool.c

@ -509,7 +509,7 @@ void realloc_strcat(char **ptr, const char *s)
sprintf(ofs, "%s", s); sprintf(ofs, "%s", s);
} }
void dealloc(void **ptr) void _dealloc(void **ptr)
{ {
free(*ptr); free(*ptr);
*ptr = NULL; *ptr = NULL;
@ -614,7 +614,7 @@ static const int b58tobin_tbl[] = {
/* b58bin should always be at least 25 bytes long and already checked to be /* b58bin should always be at least 25 bytes long and already checked to be
* valid. */ * valid. */
void b58tobin(uchar *b58bin, const uchar *b58) void b58tobin(char *b58bin, const char *b58)
{ {
uint32_t c, bin32[7]; uint32_t c, bin32[7];
int len, i, j; int len, i, j;
@ -641,9 +641,9 @@ void b58tobin(uchar *b58bin, const uchar *b58)
static const char base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static const char base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
/* Return a malloced string of *src encoded into mime base 64 */ /* Return a malloced string of *src encoded into mime base 64 */
uchar *http_base64(const uchar *src) char *http_base64(const char *src)
{ {
uchar *str, *dst; char *str, *dst;
size_t l, hlen; size_t l, hlen;
int t, r; int t, r;
@ -691,9 +691,9 @@ uchar *http_base64(const uchar *src)
return (str); return (str);
} }
void address_to_pubkeytxn(uchar *pkh, const uchar *addr) void address_to_pubkeytxn(char *pkh, const char *addr)
{ {
uchar b58bin[25]; char b58bin[25];
memset(b58bin, 0, 25); memset(b58bin, 0, 25);
b58tobin(b58bin, addr); b58tobin(b58bin, addr);

10
src/libckpool.h

@ -44,6 +44,8 @@
#define ck_runlock(_lock) _ck_runlock(_lock, __FILE__, __func__, __LINE__) #define ck_runlock(_lock) _ck_runlock(_lock, __FILE__, __func__, __LINE__)
#define ck_wunlock(_lock) _ck_wunlock(_lock, __FILE__, __func__, __LINE__) #define ck_wunlock(_lock) _ck_wunlock(_lock, __FILE__, __func__, __LINE__)
#define dealloc(ptr) _dealloc((void *)(ptr))
/* Placeholders for when we have more comprehensive logging facilities */ /* Placeholders for when we have more comprehensive logging facilities */
#define LOGERR(fmt, ...) do { \ #define LOGERR(fmt, ...) do { \
if (fmt) { \ if (fmt) { \
@ -145,14 +147,14 @@ int read_socket_line(int fd, void **buf);
void align_len(size_t *len); void align_len(size_t *len);
void realloc_strcat(char **ptr, const char *s); void realloc_strcat(char **ptr, const char *s);
void dealloc(void **ptr); void _dealloc(void **ptr);
void __bin2hex(uchar *s, const uchar *p, size_t len); void __bin2hex(uchar *s, const uchar *p, size_t len);
void *bin2hex(const uchar *p, size_t len); void *bin2hex(const uchar *p, size_t len);
bool hex2bin(uchar *p, const uchar *hexstr, size_t len); bool hex2bin(uchar *p, const uchar *hexstr, size_t len);
uchar *http_base64(const uchar *src); char *http_base64(const char *src);
void b58tobin(uchar *b58bin, const uchar *b58); void b58tobin(char *b58bin, const char *b58);
void address_to_pubkeytxn(uchar *pkh, const uchar *addr); void address_to_pubkeytxn(char *pkh, const char *addr);
int ser_number(uchar *s, int32_t val); int ser_number(uchar *s, int32_t val);
bool fulltest(const uchar *hash, const uchar *target); bool fulltest(const uchar *hash, const uchar *target);

Loading…
Cancel
Save