Explorar o código

Change dstr_init_strref to dstr_init_copy_strref

jp9000 %!s(int64=11) %!d(string=hai) anos
pai
achega
52c0d223fd
Modificáronse 3 ficheiros con 4 adicións e 4 borrados
  1. 2 2
      libobs/util/cf-lexer.c
  2. 1 1
      libobs/util/dstr.c
  3. 1 1
      libobs/util/dstr.h

+ 2 - 2
libobs/util/cf-lexer.c

@@ -955,7 +955,7 @@ static bool cf_preprocessor(struct cf_preprocessor *pp,
 	           strref_cmp(&cur_token->str, "endif") == 0) {
 		if (!if_block) {
 			struct dstr name;
-			dstr_init_strref(&name, &cur_token->str);
+			dstr_init_copy_strref(&name, &cur_token->str);
 			cf_adderror(pp, cur_token,"#$1 outside of "
 			                          "#if/#ifdef/#ifndef block",
 			                          name.array, NULL, NULL);
@@ -1285,7 +1285,7 @@ void cf_preprocessor_add_def(struct cf_preprocessor *pp, struct cf_def *def)
 
 	if (existing) {
 		struct dstr name;
-		dstr_init_strref(&name, &def->name.str);
+		dstr_init_copy_strref(&name, &def->name.str);
 		cf_addwarning(pp, &def->name, "Token $1 already defined",
 				name.array, NULL, NULL);
 		cf_addwarning(pp, &existing->name,

+ 1 - 1
libobs/util/dstr.c

@@ -284,7 +284,7 @@ void strlist_free(char **strlist)
 	}
 }
 
-void dstr_init_strref(struct dstr *dst, const struct strref *src)
+void dstr_init_copy_strref(struct dstr *dst, const struct strref *src)
 {
 	dstr_init(dst);
 	dstr_copy_strref(dst, src);

+ 1 - 1
libobs/util/dstr.h

@@ -60,7 +60,7 @@ static inline void dstr_init_move_array(struct dstr *dst, char *str);
 static inline void dstr_init_copy(struct dstr *dst, const char *src);
 static inline void dstr_init_copy_dstr(struct dstr *dst,
 		const struct dstr *src);
-EXPORT void dstr_init_strref(struct dstr *dst, const struct strref *src);
+EXPORT void dstr_init_copy_strref(struct dstr *dst, const struct strref *src);
 
 static inline void dstr_free(struct dstr *dst);
 static inline void dstr_array_free(struct dstr *array, const size_t count);