From: Philippe Normand Date: Wed, 2 Mar 2022 12:52:37 +0000 (+0000) Subject: validate: Change IssueId type to guint32 X-Git-Tag: 1.22.0~2118 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5ea0c20a339f53900f109b154e5c4191920720d8;p=platform%2Fupstream%2Fgstreamer.git validate: Change IssueId type to guint32 Which is a bit more bindings-friendly. Part-of: --- diff --git a/subprojects/gst-devtools/validate/gst/validate/gst-validate-override.c b/subprojects/gst-devtools/validate/gst/validate/gst-validate-override.c index fc2ceec..cbd7e88 100644 --- a/subprojects/gst-devtools/validate/gst/validate/gst-validate-override.c +++ b/subprojects/gst-devtools/validate/gst/validate/gst-validate-override.c @@ -137,8 +137,8 @@ void gst_validate_override_change_severity (GstValidateOverride * override, GstValidateIssueId issue_id, GstValidateReportLevel new_level) { - g_hash_table_insert (override->priv->level_override, (gpointer) issue_id, - (gpointer) new_level); + g_hash_table_insert (override->priv->level_override, + GINT_TO_POINTER (issue_id), (gpointer) new_level); } /* @@ -153,7 +153,7 @@ gst_validate_override_get_severity (GstValidateOverride * override, GstValidateReportLevel *level = NULL; if (g_hash_table_lookup_extended (override->priv->level_override, - (gpointer) issue_id, NULL, (gpointer) & level)) { + GINT_TO_POINTER (issue_id), NULL, (gpointer) & level)) { return GPOINTER_TO_INT (level); } diff --git a/subprojects/gst-devtools/validate/gst/validate/gst-validate-report.c b/subprojects/gst-devtools/validate/gst/validate/gst-validate-report.c index 0a455d4..50df68c 100644 --- a/subprojects/gst-devtools/validate/gst/validate/gst-validate-report.c +++ b/subprojects/gst-devtools/validate/gst/validate/gst-validate-report.c @@ -144,7 +144,7 @@ G_DEFINE_BOXED_TYPE (GstValidateIssue, gst_validate_issue, (GBoxedCopyFunc) gst_validate_issue_ref, (GBoxedFreeFunc) gst_validate_issue_unref); -GstValidateIssueId +guint32 gst_validate_issue_get_id (GstValidateIssue * issue) { return issue->issue_id; @@ -247,10 +247,10 @@ void gst_validate_issue_register (GstValidateIssue * issue) { g_return_if_fail (g_hash_table_lookup (_gst_validate_issues, - (gpointer) gst_validate_issue_get_id (issue)) == NULL); + GINT_TO_POINTER (gst_validate_issue_get_id (issue))) == NULL); g_hash_table_insert (_gst_validate_issues, - (gpointer) gst_validate_issue_get_id (issue), issue); + GINT_TO_POINTER (gst_validate_issue_get_id (issue)), issue); } #define REGISTER_VALIDATE_ISSUE(lvl,id,sum,desc) \ @@ -673,7 +673,7 @@ gst_validate_report_deinit (void) GstValidateIssue * gst_validate_issue_from_id (GstValidateIssueId issue_id) { - return g_hash_table_lookup (_gst_validate_issues, (gpointer) issue_id); + return g_hash_table_lookup (_gst_validate_issues, GINT_TO_POINTER (issue_id)); } /* TODO how are these functions going to work with extensions */ @@ -754,7 +754,7 @@ gst_validate_report_check_abort (GstValidateReport * report) return FALSE; } -GstValidateIssueId +guint32 gst_validate_report_get_issue_id (GstValidateReport * report) { return gst_validate_issue_get_id (report->issue); @@ -1386,7 +1386,7 @@ gst_validate_skip_test (const gchar * format, ...) static void print_issue (gpointer key, GstValidateIssue * issue, gpointer user_data) { - gst_validate_printf (NULL, "\n# `%s` (%" G_GUINTPTR_FORMAT ")\n\n", + gst_validate_printf (NULL, "\n# `%s` (%" G_GUINT32_FORMAT ")\n\n", g_quark_to_string (issue->issue_id), issue->issue_id); gst_validate_printf (NULL, "%c%s\n\n", g_ascii_toupper (issue->summary[0]), &issue->summary[1]); diff --git a/subprojects/gst-devtools/validate/gst/validate/gst-validate-report.h b/subprojects/gst-devtools/validate/gst/validate/gst-validate-report.h index c16a420..dbc39d3 100644 --- a/subprojects/gst-devtools/validate/gst/validate/gst-validate-report.h +++ b/subprojects/gst-devtools/validate/gst/validate/gst-validate-report.h @@ -25,7 +25,7 @@ #include typedef struct _GstValidateReport GstValidateReport; -typedef guintptr GstValidateIssueId; +typedef GQuark GstValidateIssueId; #include #include @@ -241,7 +241,7 @@ struct _GstValidateReport { void gst_validate_report_add_message (GstValidateReport *report, const gchar *message); -#define GST_VALIDATE_ISSUE_FORMAT G_GUINTPTR_FORMAT " (%s) : %s: %s" +#define GST_VALIDATE_ISSUE_FORMAT G_GUINT32_FORMAT " (%s) : %s: %s" #define GST_VALIDATE_ISSUE_ARGS(i) gst_validate_issue_get_id (i), \ gst_validate_report_level_get_name (i->default_level), \ i->area, \ @@ -257,7 +257,7 @@ void gst_validate_report_init (void); GST_VALIDATE_API GstValidateIssue *gst_validate_issue_from_id (GstValidateIssueId issue_id); GST_VALIDATE_API -GstValidateIssueId gst_validate_issue_get_id (GstValidateIssue * issue); +guint32 gst_validate_issue_get_id (GstValidateIssue * issue); GST_VALIDATE_API void gst_validate_issue_register (GstValidateIssue * issue); GST_VALIDATE_API @@ -282,7 +282,7 @@ GST_VALIDATE_API GstValidateReport *gst_validate_report_ref (GstValidateReport * report); GST_VALIDATE_API -GstValidateIssueId gst_validate_report_get_issue_id (GstValidateReport * report); +guint32 gst_validate_report_get_issue_id (GstValidateReport * report); GST_VALIDATE_API gboolean gst_validate_report_check_abort (GstValidateReport * report); @@ -333,4 +333,3 @@ void gst_validate_skip_test (const gchar* format, ...); G_END_DECLS #endif /* __GST_VALIDATE_REPORT_H__ */ - diff --git a/subprojects/gst-devtools/validate/gst/validate/gst-validate-reporter.c b/subprojects/gst-devtools/validate/gst/validate/gst-validate-reporter.c index 2fa7fe3..2b7a4a5 100644 --- a/subprojects/gst-devtools/validate/gst/validate/gst-validate-reporter.c +++ b/subprojects/gst-devtools/validate/gst/validate/gst-validate-reporter.c @@ -161,7 +161,7 @@ gst_validate_reporter_get_report (GstValidateReporter * reporter, GstValidateReporterPrivate *priv = gst_validate_reporter_get_priv (reporter); GST_VALIDATE_REPORTER_REPORTS_LOCK (reporter); - report = g_hash_table_lookup (priv->reports, (gconstpointer) issue_id); + report = g_hash_table_lookup (priv->reports, GINT_TO_POINTER (issue_id)); GST_VALIDATE_REPORTER_REPORTS_UNLOCK (reporter); return report; @@ -216,7 +216,7 @@ gst_validate_report_valist (GstValidateReporter * reporter, goto done; } - prev_report = g_hash_table_lookup (priv->reports, (gconstpointer) issue_id); + prev_report = g_hash_table_lookup (priv->reports, GINT_TO_POINTER (issue_id)); runner = gst_validate_reporter_get_runner (reporter); if (prev_report && prev_report->level != GST_VALIDATE_REPORT_LEVEL_EXPECTED) { @@ -240,7 +240,7 @@ gst_validate_report_valist (GstValidateReporter * reporter, } GST_VALIDATE_REPORTER_REPORTS_LOCK (reporter); - g_hash_table_insert (priv->reports, (gpointer) issue_id, report); + g_hash_table_insert (priv->reports, GINT_TO_POINTER (issue_id), report); GST_VALIDATE_REPORTER_REPORTS_UNLOCK (reporter); if (runner && int_ret == GST_VALIDATE_REPORTER_REPORT) { diff --git a/subprojects/gst-devtools/validate/gst/validate/gst-validate-runner.c b/subprojects/gst-devtools/validate/gst/validate/gst-validate-runner.c index f1f2f27..a45da8e 100644 --- a/subprojects/gst-devtools/validate/gst/validate/gst-validate-runner.c +++ b/subprojects/gst-devtools/validate/gst/validate/gst-validate-runner.c @@ -564,10 +564,10 @@ synthesize_reports (GstValidateRunner * runner, GstValidateReport * report) GST_VALIDATE_RUNNER_LOCK (runner); reports = g_hash_table_lookup (runner->priv->reports_by_type, - (gconstpointer) issue_id); + GINT_TO_POINTER (issue_id)); reports = g_list_append (reports, gst_validate_report_ref (report)); - g_hash_table_insert (runner->priv->reports_by_type, (gpointer) issue_id, - reports); + g_hash_table_insert (runner->priv->reports_by_type, + GINT_TO_POINTER (issue_id), reports); GST_VALIDATE_RUNNER_UNLOCK (runner); }