]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix "warning: cast from 'const void *' to 'char *' drops const qualifier".
authorBruno Haible <bruno@clisp.org>
Sun, 6 Sep 2020 21:07:51 +0000 (23:07 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 9 Oct 2022 07:30:42 +0000 (09:30 +0200)
* libtextstyle/gnulib-local/lib/fd-ostream.oo.c (fd_ostream::write_mem): Add
'const'.

libtextstyle/gnulib-local/lib/fd-ostream.oo.c

index ccea297d31b8b29296082ab94efab53a5522d357..cabe2a07ce00a8b8942f2aaa0ea4c1f85cfff662 100644 (file)
@@ -1,5 +1,5 @@
 /* Output stream referring to a file descriptor.
-   Copyright (C) 2006-2007, 2019 Free Software Foundation, Inc.
+   Copyright (C) 2006-2007, 2019-2020 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
@@ -85,7 +85,7 @@ fd_ostream::write_mem (fd_ostream_t stream, const void *data, size_t len)
               if (n > 0)
                 {
                   memcpy (stream->buffer + BUFSIZE - stream->avail, data, n);
-                  data = (char *) data + n;
+                  data = (const char *) data + n;
                   stream->avail -= n;
                   len -= n;
                 }
@@ -114,7 +114,7 @@ fd_ostream::write_mem (fd_ostream_t stream, const void *data, size_t len)
                    - a last chunk, which is copied to the buffer.  */
               size_t n = stream->avail;
               memcpy (stream->buffer + BUFSIZE - stream->avail, data, n);
-              data = (char *) data + n;
+              data = (const char *) data + n;
               len -= n;
               if (full_write (stream->fd, stream->buffer, BUFSIZE) < BUFSIZE)
                 error (EXIT_FAILURE, errno, _("error writing to %s"),
@@ -125,7 +125,7 @@ fd_ostream::write_mem (fd_ostream_t stream, const void *data, size_t len)
                   if (full_write (stream->fd, data, BUFSIZE) < BUFSIZE)
                     error (EXIT_FAILURE, errno, _("error writing to %s"),
                            stream->filename);
-                  data = (char *) data + BUFSIZE;
+                  data = (const char *) data + BUFSIZE;
                   len -= BUFSIZE;
                 }