[gjs: 6/12] jsapi-util-string: Return smart pointer from gjs_hyphen_to_underscore()
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 6/12] jsapi-util-string: Return smart pointer from gjs_hyphen_to_underscore()
- Date: Sun, 11 Apr 2021 23:22:50 +0000 (UTC)
commit c526d1748aa1ca402149c617a4710676f3f9ed6c
Author: Philip Chimento <philip chimento gmail com>
Date: Sun Mar 21 11:16:06 2021 -0700
jsapi-util-string: Return smart pointer from gjs_hyphen_to_underscore()
gjs/jsapi-util-string.cpp | 2 +-
gjs/jsapi-util.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gjs/jsapi-util-string.cpp b/gjs/jsapi-util-string.cpp
index 45f297a7..3f66340e 100644
--- a/gjs/jsapi-util-string.cpp
+++ b/gjs/jsapi-util-string.cpp
@@ -44,7 +44,7 @@ struct GCPolicy<void*> : public IgnoreGCPolicy<void*> {};
class JSLinearString;
-char* gjs_hyphen_to_underscore(const char* str) {
+GjsAutoChar gjs_hyphen_to_underscore(const char* str) {
char *s = g_strdup(str);
char *retval = s;
while (*(s++) != '\0') {
diff --git a/gjs/jsapi-util.h b/gjs/jsapi-util.h
index 933e80a8..4e399f25 100644
--- a/gjs/jsapi-util.h
+++ b/gjs/jsapi-util.h
@@ -539,7 +539,7 @@ bool gjs_object_require_converted_property(JSContext *context,
[[nodiscard]] std::string gjs_debug_value(JS::Value v);
[[nodiscard]] std::string gjs_debug_id(jsid id);
-[[nodiscard]] char* gjs_hyphen_to_underscore(const char* str);
+[[nodiscard]] GjsAutoChar gjs_hyphen_to_underscore(const char* str);
[[nodiscard]] GjsAutoChar gjs_hyphen_to_camel(const char* str);
#if defined(G_OS_WIN32) && (defined(_MSC_VER) && (_MSC_VER >= 1900))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]