[svn:parrot] r36233 - in branches/pdd28str_part2: include/parrot languages/dotnet/pmc src src/pmc src/string src/string/charset

allison at svn.parrot.org allison at svn.parrot.org
Sun Feb 1 06:48:25 UTC 2009


Author: allison
Date: Sun Feb  1 06:48:24 2009
New Revision: 36233
URL: https://trac.parrot.org/parrot/changeset/36233

Log:
[pdd28str] Renaming 'Parrot_str_new_init'.

Modified:
   branches/pdd28str_part2/include/parrot/string_funcs.h
   branches/pdd28str_part2/languages/dotnet/pmc/dotnetassembly.pmc
   branches/pdd28str_part2/src/dynext.c
   branches/pdd28str_part2/src/global_setup.c
   branches/pdd28str_part2/src/hll.c
   branches/pdd28str_part2/src/packfile.c
   branches/pdd28str_part2/src/pmc/packfile.pmc
   branches/pdd28str_part2/src/pmc/packfilesegment.pmc
   branches/pdd28str_part2/src/string/api.c
   branches/pdd28str_part2/src/string/charset/unicode.c

Modified: branches/pdd28str_part2/include/parrot/string_funcs.h
==============================================================================
--- branches/pdd28str_part2/include/parrot/string_funcs.h	Sun Feb  1 06:28:56 2009	(r36232)
+++ branches/pdd28str_part2/include/parrot/string_funcs.h	Sun Feb  1 06:48:24 2009	(r36233)
@@ -353,7 +353,7 @@
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-STRING * string_make_direct(PARROT_INTERP,
+STRING * Parrot_str_new_init(PARROT_INTERP,
     ARGIN_NULLOK(const char *buffer),
     UINTVAL len,
     ARGIN(const ENCODING *encoding),
@@ -663,7 +663,7 @@
        PARROT_ASSERT_ARG(s)
 #define ASSERT_ARGS_string_make __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_string_make_direct __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_str_new_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(encoding)
 #define ASSERT_ARGS_Parrot_str_new_noinit __attribute__unused__ int _ASSERT_ARGS_CHECK = \

Modified: branches/pdd28str_part2/languages/dotnet/pmc/dotnetassembly.pmc
==============================================================================
--- branches/pdd28str_part2/languages/dotnet/pmc/dotnetassembly.pmc	Sun Feb  1 06:28:56 2009	(r36232)
+++ branches/pdd28str_part2/languages/dotnet/pmc/dotnetassembly.pmc	Sun Feb  1 06:48:24 2009	(r36233)
@@ -1989,7 +1989,7 @@
                "Blob position and length out of range");
 
         /* Return string. */
-        result = string_make_direct(INTERP, ass->user_strings + start,
+        result = Parrot_str_new_init(INTERP, ass->user_strings + start,
                     length - 1, encoding, charset, 0);
         RETURN(STRING *result);
     }

Modified: branches/pdd28str_part2/src/dynext.c
==============================================================================
--- branches/pdd28str_part2/src/dynext.c	Sun Feb  1 06:28:56 2009	(r36232)
+++ branches/pdd28str_part2/src/dynext.c	Sun Feb  1 06:48:24 2009	(r36233)
@@ -454,7 +454,7 @@
     STRING * const  orig   = VTABLE_get_string(s, value);
     char   * const raw_str = string_to_cstring(s, orig);
     STRING * const   ret   =
-        string_make_direct(d, raw_str, strlen(raw_str),
+        Parrot_str_new_init(d, raw_str, strlen(raw_str),
             PARROT_DEFAULT_ENCODING, PARROT_DEFAULT_CHARSET,
             PObj_constant_FLAG);
     string_cstring_free(raw_str);

Modified: branches/pdd28str_part2/src/global_setup.c
==============================================================================
--- branches/pdd28str_part2/src/global_setup.c	Sun Feb  1 06:28:56 2009	(r36232)
+++ branches/pdd28str_part2/src/global_setup.c	Sun Feb  1 06:48:24 2009	(r36233)
@@ -90,7 +90,7 @@
 
     if (parrot_config_size_stored > 1) {
         STRING * const config_string =
-            string_make_direct(interp,
+            Parrot_str_new_init(interp,
                                (const char *)parrot_config_stored, parrot_config_size_stored,
                                PARROT_DEFAULT_ENCODING, PARROT_DEFAULT_CHARSET,
                                PObj_external_FLAG|PObj_constant_FLAG);

Modified: branches/pdd28str_part2/src/hll.c
==============================================================================
--- branches/pdd28str_part2/src/hll.c	Sun Feb  1 06:28:56 2009	(r36232)
+++ branches/pdd28str_part2/src/hll.c	Sun Feb  1 06:48:24 2009	(r36233)
@@ -97,7 +97,7 @@
     if (entry_name && !STRING_IS_EMPTY(entry_name)) {
         char   * const cstring    = string_to_cstring(interp, entry_name);
         const  UINTVAL len        = string_length(interp, entry_name);
-        STRING *const_name        = string_make_direct(interp, cstring,
+        STRING *const_name        = Parrot_str_new_init(interp, cstring,
             len, PARROT_DEFAULT_ENCODING, PARROT_DEFAULT_CHARSET,
             PObj_constant_FLAG);
 

Modified: branches/pdd28str_part2/src/packfile.c
==============================================================================
--- branches/pdd28str_part2/src/packfile.c	Sun Feb  1 06:28:56 2009	(r36232)
+++ branches/pdd28str_part2/src/packfile.c	Sun Feb  1 06:48:24 2009	(r36233)
@@ -2720,7 +2720,7 @@
     mem_realloc_n_typed(ct->constants, ct->const_count, PackFile_Constant *);
     fnconst = PackFile_Constant_new(interp);
     fnconst->type = PFC_STRING;
-    fnconst->u.string = string_make_direct(interp, filename,
+    fnconst->u.string = Parrot_str_new_init(interp, filename,
         strlen(filename), PARROT_DEFAULT_ENCODING,
         PARROT_DEFAULT_CHARSET, PObj_constant_FLAG);
     ct->constants[ct->const_count - 1] = fnconst;

Modified: branches/pdd28str_part2/src/pmc/packfile.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/packfile.pmc	Sun Feb  1 06:28:56 2009	(r36232)
+++ branches/pdd28str_part2/src/pmc/packfile.pmc	Sun Feb  1 06:48:24 2009	(r36233)
@@ -68,7 +68,7 @@
         opcode_t *ptr = (opcode_t*)mem_sys_allocate(length);
         STRING *str;
         PackFile_pack(interp, pf, ptr);
-        str = string_make_direct(interp, (const char*)ptr, length,
+        str = Parrot_str_new_init(interp, (const char*)ptr, length,
                 PARROT_FIXED_8_ENCODING, PARROT_BINARY_CHARSET, 0);
         mem_sys_free(ptr);
         return str;

Modified: branches/pdd28str_part2/src/pmc/packfilesegment.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/packfilesegment.pmc	Sun Feb  1 06:28:56 2009	(r36232)
+++ branches/pdd28str_part2/src/pmc/packfilesegment.pmc	Sun Feb  1 06:48:24 2009	(r36233)
@@ -57,7 +57,7 @@
         opcode_t *newptr, *ptr = (opcode_t*)mem_sys_allocate(length);
         STRING *str;
         newptr = PackFile_Segment_pack(interp, pfseg, ptr);
-        str = string_make_direct(interp, (const char*)ptr,
+        str = Parrot_str_new_init(interp, (const char*)ptr,
                 (newptr - ptr) * sizeof (opcode_t),
                 PARROT_FIXED_8_ENCODING, PARROT_BINARY_CHARSET, 0);
         mem_sys_free(ptr);

Modified: branches/pdd28str_part2/src/string/api.c
==============================================================================
--- branches/pdd28str_part2/src/string/api.c	Sun Feb  1 06:28:56 2009	(r36232)
+++ branches/pdd28str_part2/src/string/api.c	Sun Feb  1 06:48:24 2009	(r36233)
@@ -318,7 +318,7 @@
     for (i = 0; i < n_parrot_cstrings; ++i) {
         DECL_CONST_CAST;
         STRING * const s =
-            string_make_direct(interp,
+            Parrot_str_new_init(interp,
                 parrot_cstrings[i].string,
                 parrot_cstrings[i].len,
                 PARROT_DEFAULT_ENCODING, PARROT_DEFAULT_CHARSET,
@@ -507,7 +507,7 @@
                 cs  = a->charset;
                 enc = a->encoding;
             }
-            result = string_make_direct(interp, NULL, a->bufused + b->bufused,
+            result = Parrot_str_new_init(interp, NULL, a->bufused + b->bufused,
                         enc, cs, 0);
 
             result = Parrot_str_append(interp, result, a);
@@ -623,7 +623,7 @@
 Parrot_str_new(PARROT_INTERP, ARGIN_NULLOK(const char * const buffer), const UINTVAL len)
 {
     ASSERT_ARGS(Parrot_str_new)
-    return string_make_direct(interp, buffer, len ? len :
+    return Parrot_str_new_init(interp, buffer, len ? len :
             buffer ? strlen(buffer) : 0,
                               PARROT_DEFAULT_ENCODING, PARROT_DEFAULT_CHARSET,
                               0); /* Force an 8-bit encoding at some
@@ -684,7 +684,7 @@
     if (s)
         return s;
 
-    s = string_make_direct(interp, buffer, strlen(buffer),
+    s = Parrot_str_new_init(interp, buffer, strlen(buffer),
                        PARROT_DEFAULT_ENCODING, PARROT_DEFAULT_CHARSET,
                        PObj_external_FLAG|PObj_constant_FLAG);
 
@@ -741,14 +741,14 @@
             "Can't make '%s' charset strings", charset_name);
 
 
-    return string_make_direct(interp, buffer, len,
+    return Parrot_str_new_init(interp, buffer, len,
         charset->preferred_encoding, charset, flags);
 
 }
 
 /*
 
-=item C<STRING * string_make_direct>
+=item C<STRING * Parrot_str_new_init>
 
 Given a buffer, its length, an encoding, a character set, and STRING flags,
 creates and returns a new string.  Don't call this directly.
@@ -761,10 +761,10 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 STRING *
-string_make_direct(PARROT_INTERP, ARGIN_NULLOK(const char *buffer), UINTVAL len,
+Parrot_str_new_init(PARROT_INTERP, ARGIN_NULLOK(const char *buffer), UINTVAL len,
         ARGIN(const ENCODING *encoding), ARGIN_NULLOK(const CHARSET *charset), UINTVAL flags)
 {
-    ASSERT_ARGS(string_make_direct)
+    ASSERT_ARGS(Parrot_str_new_init)
     DECL_CONST_CAST;
     STRING * const s = new_string_header(interp, flags);
     s->encoding      = encoding;
@@ -1097,7 +1097,7 @@
     ASSERT_ARGS(string_repeat)
     UINTVAL i;
 
-    STRING * const dest = string_make_direct(interp, NULL,
+    STRING * const dest = Parrot_str_new_init(interp, NULL,
                         s->bufused * num,
                         s->encoding, s->charset, 0);
 
@@ -1136,7 +1136,7 @@
 Parrot_str_repeat(PARROT_INTERP, ARGIN(const STRING *s), UINTVAL num)
 {
     ASSERT_ARGS(Parrot_str_repeat)
-    STRING * const dest = string_make_direct(interp, NULL,
+    STRING * const dest = Parrot_str_new_init(interp, NULL,
                         s->bufused * num,
                         s->encoding, s->charset, 0);
     if (num > 0) {
@@ -1622,7 +1622,7 @@
         res->charset  = Parrot_binary_charset_ptr;
     }
     else
-        res = string_make_direct(interp, NULL, minlen,
+        res = Parrot_str_new_init(interp, NULL, minlen,
                 Parrot_fixed_8_encoding_ptr, Parrot_binary_charset_ptr, 0);
 
     if (!s1 || !s2) {
@@ -1775,7 +1775,7 @@
         res->charset  = Parrot_binary_charset_ptr;
     }
     else
-        res = string_make_direct(interp, NULL, maxlen,
+        res = Parrot_str_new_init(interp, NULL, maxlen,
                 Parrot_fixed_8_encoding_ptr, Parrot_binary_charset_ptr, 0);
 
     if (!maxlen) {
@@ -1850,7 +1850,7 @@
         res->charset  = Parrot_binary_charset_ptr;
     }
     else
-        res = string_make_direct(interp, NULL, maxlen,
+        res = Parrot_str_new_init(interp, NULL, maxlen,
                 Parrot_fixed_8_encoding_ptr, Parrot_binary_charset_ptr, 0);
 
     if (!maxlen) {
@@ -1928,7 +1928,7 @@
         res->charset  = Parrot_binary_charset_ptr;
     }
     else
-        res = string_make_direct(interp, NULL, len,
+        res = Parrot_str_new_init(interp, NULL, len,
                 Parrot_fixed_8_encoding_ptr, Parrot_binary_charset_ptr, 0);
 
     if (!len) {
@@ -2455,7 +2455,7 @@
         charlen = 16;
 
     /* create ascii result */
-    result = string_make_direct(interp, NULL, charlen,
+    result = Parrot_str_new_init(interp, NULL, charlen,
             Parrot_fixed_8_encoding_ptr, Parrot_ascii_charset_ptr, 0);
 
     /* more work TODO */
@@ -2603,7 +2603,7 @@
             Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
                 "Can't make '%s' charset strings", p + 1);
 
-        result   = string_make_direct(interp, cstring, clength,
+        result   = Parrot_str_new_init(interp, cstring, clength,
                         encoding, charset, flags);
         encoding = Parrot_fixed_8_encoding_ptr;
     }

Modified: branches/pdd28str_part2/src/string/charset/unicode.c
==============================================================================
--- branches/pdd28str_part2/src/string/charset/unicode.c	Sun Feb  1 06:28:56 2009	(r36232)
+++ branches/pdd28str_part2/src/string/charset/unicode.c	Sun Feb  1 06:48:24 2009	(r36233)
@@ -343,7 +343,7 @@
        UErrorCode *status);
        */
     dest_len = src_len = src->strlen;
-    dest     = string_make_direct(interp, NULL, src_len * sizeof (UChar),
+    dest     = Parrot_str_new_init(interp, NULL, src_len * sizeof (UChar),
             src->encoding, src->charset, 0);
 
     err      = U_ZERO_ERROR;


More information about the parrot-commits mailing list