mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-30 16:10:44 +08:00
Return int
from internal sbuf_len
function
This silences lots of warnings where the result is implicitly converted to `int`
This commit is contained in:
parent
0c6fd78251
commit
35ddd9ec01
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -203,7 +204,7 @@ sbuf_catb(safebuf_t *s1, const safebuf_t *s2) {
|
|||||||
size_t res;
|
size_t res;
|
||||||
assert(SAFEBUF_CHECK(s1));
|
assert(SAFEBUF_CHECK(s1));
|
||||||
assert(SAFEBUF_CHECK(s2));
|
assert(SAFEBUF_CHECK(s2));
|
||||||
s2len = sbuf_len(s2);
|
s2len = (size_t)sbuf_len(s2);
|
||||||
sbuf_grow(s1, 1 + s1->cl + s2len);
|
sbuf_grow(s1, 1 + s1->cl + s2len);
|
||||||
res = strlcat(s1->buf + s1->cl, s2->buf, s1->len - s1->cl);
|
res = strlcat(s1->buf + s1->cl, s2->buf, s1->len - s1->cl);
|
||||||
assert( res < s1->len );
|
assert( res < s1->len );
|
||||||
@ -212,10 +213,10 @@ sbuf_catb(safebuf_t *s1, const safebuf_t *s2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Return length of string in sbuf */
|
/* Return length of string in sbuf */
|
||||||
size_t
|
int
|
||||||
sbuf_len(const safebuf_t *sb) {
|
sbuf_len(const safebuf_t *sb) {
|
||||||
assert(SAFEBUF_CHECK(sb));
|
assert(SAFEBUF_CHECK(sb));
|
||||||
return sb->cl;
|
return (int)sb->cl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return C string in an sbuf */
|
/* Return C string in an sbuf */
|
||||||
|
@ -99,7 +99,7 @@ void sbuf_cat(safebuf_t *sbuf, const char *s2);
|
|||||||
void sbuf_catb(safebuf_t *s1, const safebuf_t *s2);
|
void sbuf_catb(safebuf_t *s1, const safebuf_t *s2);
|
||||||
|
|
||||||
/* Return length of the string in sbuf */
|
/* Return length of the string in sbuf */
|
||||||
size_t sbuf_len(const safebuf_t *sbuf);
|
int sbuf_len(const safebuf_t *sbuf);
|
||||||
|
|
||||||
/* Return the C string inside an sbuf */
|
/* Return the C string inside an sbuf */
|
||||||
char *sbuf_str(const safebuf_t *sbuf);
|
char *sbuf_str(const safebuf_t *sbuf);
|
||||||
|
Loading…
Reference in New Issue
Block a user