[gjs] coverage: Use correct constness for prefixes
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] coverage: Use correct constness for prefixes
- Date: Wed, 21 Dec 2016 01:58:25 +0000 (UTC)
commit be554f068ac69cf229eec9b42af3efa08e07ad12
Author: Philip Chimento <philip endlessm com>
Date: Fri Dec 9 18:26:23 2016 -0800
coverage: Use correct constness for prefixes
Both levels of pointers should be const, or else you have to add a cast
in C++. (You have to add a cast in C in any case.)
https://bugzilla.gnome.org/show_bug.cgi?id=775776
gjs/console.cpp | 3 +--
gjs/coverage.cpp | 6 +++---
gjs/coverage.h | 6 +++---
3 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/gjs/console.cpp b/gjs/console.cpp
index 34c41e0..a70e2b7 100644
--- a/gjs/console.cpp
+++ b/gjs/console.cpp
@@ -265,8 +265,7 @@ main(int argc, char **argv)
g_error("--coverage-output is required when taking coverage statistics");
GFile *output = g_file_new_for_commandline_arg(coverage_output_path);
- coverage = gjs_coverage_new((const char **) coverage_prefixes, js_context,
- output);
+ coverage = gjs_coverage_new(coverage_prefixes, js_context, output);
g_object_unref(output);
}
diff --git a/gjs/coverage.cpp b/gjs/coverage.cpp
index 8580a0c..406664a 100644
--- a/gjs/coverage.cpp
+++ b/gjs/coverage.cpp
@@ -1846,9 +1846,9 @@ gjs_coverage_class_init (GjsCoverageClass *klass)
* Returns: A #GjsCoverage object
*/
GjsCoverage *
-gjs_coverage_new (const char **prefixes,
- GjsContext *context,
- GFile *output_dir)
+gjs_coverage_new (const char * const *prefixes,
+ GjsContext *context,
+ GFile *output_dir)
{
GjsCoverage *coverage =
GJS_COVERAGE(g_object_new(GJS_TYPE_COVERAGE,
diff --git a/gjs/coverage.h b/gjs/coverage.h
index 3646c5c..4d91fa0 100644
--- a/gjs/coverage.h
+++ b/gjs/coverage.h
@@ -74,9 +74,9 @@ GType gjs_coverage_get_type(void);
*/
void gjs_coverage_write_statistics(GjsCoverage *self);
-GjsCoverage * gjs_coverage_new(const char **coverage_prefixes,
- GjsContext *coverage_context,
- GFile *output_dir);
+GjsCoverage * gjs_coverage_new(const char * const *coverage_prefixes,
+ GjsContext *coverage_context,
+ GFile *output_dir);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]