lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] git commit: refs/heads/cfish-string-prep1 - String's "steal" constructors shouldn't take const strings
Date Thu, 10 Oct 2013 15:00:39 GMT
Updated Branches:
  refs/heads/cfish-string-prep1 1d78ca72f -> ccfb80304


String's "steal" constructors shouldn't take const strings

The stolen buffer will be freed later, so it must not be const.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/ccfb8030
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/ccfb8030
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/ccfb8030

Branch: refs/heads/cfish-string-prep1
Commit: ccfb803048a15842860f4eebeeec9fc6a628c001
Parents: 1d78ca7
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Thu Oct 10 16:57:17 2013 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Thu Oct 10 16:57:17 2013 +0200

----------------------------------------------------------------------
 clownfish/runtime/core/Clownfish/String.c   | 6 +++---
 clownfish/runtime/core/Clownfish/String.cfh | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/ccfb8030/clownfish/runtime/core/Clownfish/String.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/String.c b/clownfish/runtime/core/Clownfish/String.c
index 41ecab2..9f691ad 100644
--- a/clownfish/runtime/core/Clownfish/String.c
+++ b/clownfish/runtime/core/Clownfish/String.c
@@ -84,7 +84,7 @@ Str_init_from_trusted_utf8(String *self, const char *utf8, size_t size)
{
 }
 
 String*
-Str_new_steal_utf8(const char *utf8, size_t size) {
+Str_new_steal_utf8(char *utf8, size_t size) {
     if (!StrHelp_utf8_valid(utf8, size)) {
         DIE_INVALID_UTF8(utf8, size);
     }
@@ -93,13 +93,13 @@ Str_new_steal_utf8(const char *utf8, size_t size) {
 }
 
 String*
-Str_new_steal_trusted_utf8(const char *utf8, size_t size) {
+Str_new_steal_trusted_utf8(char *utf8, size_t size) {
     String *self = (String*)VTable_Make_Obj(STRING);
     return Str_init_steal_trusted_utf8(self, utf8, size);
 }
 
 String*
-Str_init_steal_trusted_utf8(String *self, const char *utf8, size_t size) {
+Str_init_steal_trusted_utf8(String *self, char *utf8, size_t size) {
     self->ptr    = utf8;
     self->size   = size;
     self->origin = self;

http://git-wip-us.apache.org/repos/asf/lucy/blob/ccfb8030/clownfish/runtime/core/Clownfish/String.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/String.cfh b/clownfish/runtime/core/Clownfish/String.cfh
index ff4047a..8a065cb 100644
--- a/clownfish/runtime/core/Clownfish/String.cfh
+++ b/clownfish/runtime/core/Clownfish/String.cfh
@@ -49,19 +49,19 @@ class Clownfish::String cnick Str
      * passed-in string.  Check validity of supplied UTF-8.
      */
     inert incremented String*
-    new_steal_utf8(const char *utf8, size_t size);
+    new_steal_utf8(char *utf8, size_t size);
 
     /** Return a pointer to a new String which assumes ownership of the
      * passed-in string.  Do not check validity of supplied UTF-8.
      */
     inert incremented String*
-    new_steal_trusted_utf8(const char *utf8, size_t size);
+    new_steal_trusted_utf8(char *utf8, size_t size);
 
     /** Initialize the String using the passed-in string.  Do not check
      * validity of supplied UTF-8.
      */
     public inert String*
-    init_steal_trusted_utf8(String *self, const char *utf8, size_t size);
+    init_steal_trusted_utf8(String *self, char *utf8, size_t size);
 
     /** Return a pointer to a new String which wraps an external buffer
      * containing UTF-8.  The buffer must stay unchanged for the lifetime


Mime
View raw message