summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2001-11-23 04:24:26 +0000
committerMartin Pool <mbp@samba.org>2001-11-23 04:24:26 +0000
commit1a74f88b1fa792d215ce0a284aa96214e8995d66 (patch)
tree569e5e60aa59c98f5a185e01e94d71b29068841e /source3/lib
parent946374e8af7ca11c76d4952285ac4ac109d7778d (diff)
downloadsamba-1a74f88b1fa792d215ce0a284aa96214e8995d66.tar.gz
samba-1a74f88b1fa792d215ce0a284aa96214e8995d66.tar.bz2
samba-1a74f88b1fa792d215ce0a284aa96214e8995d66.zip
Quieten gcc const warning.
doxyfy. (This used to be commit 6ddd8e7bf69d8aee4148cbcf72de55c903d5f0a1)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/charcnv.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c
index 27e00a589e..11ae2d9143 100644
--- a/source3/lib/charcnv.c
+++ b/source3/lib/charcnv.c
@@ -79,16 +79,16 @@ void init_iconv(void)
}
}
-/****************************************************************************
- Convert string from one encoding to another, making error checking etc
- Parameters:
- descriptor - conversion descriptor, created in init_iconv
- src - pointer to source string (multibyte or singlebyte)
- srclen - length of the source string in bytes
- dest - pointer to destination string (multibyte or singlebyte)
- destlen - maximal length allowed for string
-return the number of bytes occupied in the destination
-****************************************************************************/
+/**
+ * Convert string from one encoding to another, making error checking etc
+ *
+ * @param descriptor conversion descriptor, created in init_iconv()
+ * @param src pointer to source string (multibyte or singlebyte)
+ * @param srclen length of the source string in bytes
+ * @param dest pointer to destination string (multibyte or singlebyte)
+ * @param destlen maximal length allowed for string
+ * @retval the number of bytes occupied in the destination
+ **/
size_t convert_string(charset_t from, charset_t to,
void const *src, size_t srclen,
void *dest, size_t destlen)
@@ -118,7 +118,7 @@ size_t convert_string(charset_t from, charset_t to,
i_len=srclen;
o_len=destlen;
- retval=smb_iconv(descriptor,&inbuf, &i_len, &outbuf, &o_len);
+ retval = smb_iconv(descriptor, &(const char *)inbuf, &i_len, &outbuf, &o_len);
if(retval==-1)
{
char *reason="unknown error";
@@ -142,10 +142,14 @@ size_t convert_string(charset_t from, charset_t to,
return destlen-o_len;
}
-/* you must provide source lenght -1 is not accepted as lenght.
- this function will return the size in bytes of the converted string
- or -1 in case of error.
- */
+/**
+ * Convert between character sets, allocating a new buffer for the result.
+ *
+ * @param srclen length of source buffer.
+ * @note -1 is not accepted for srclen.
+ *
+ * @retval Size in bytes of the converted string; or -1 in case of error.
+ **/
size_t convert_string_allocate(charset_t from, charset_t to,
void const *src, size_t srclen, void **dest)
{
@@ -186,8 +190,8 @@ convert:
i_len = srclen;
o_len = destlen;
retval = smb_iconv(descriptor,
- &inbuf, &i_len,
- &outbuf, &o_len);
+ &(const char *) inbuf, &i_len,
+ &outbuf, &o_len);
if(retval == -1)
{
char *reason="unknown error";