aboutsummaryrefslogtreecommitdiff
path: root/deps
diff options
context:
space:
mode:
authorbigbear <ns@bigbear.dk>2024-02-08 02:57:20 +0100
committerbigbear <ns@bigbear.dk>2024-02-08 19:52:53 +0100
commit08e01f35f747bfe30a40ea99cbcd63ad7fb94e7e (patch)
treea727faeb3ffb38d523b0700a63e6e537d295a152 /deps
parent4c249cfdc742d162fdb384fba61236cada3d9f29 (diff)
FIX GCC Warnings
Diffstat (limited to 'deps')
-rw-r--r--deps/uber-graph/g-ring.c8
-rw-r--r--deps/uber-graph/uber-line-graph.c28
-rw-r--r--deps/uber-graph/uber-scatter.c10
-rw-r--r--deps/uber-graph/uber-timeout-interval.c2
4 files changed, 24 insertions, 24 deletions
diff --git a/deps/uber-graph/g-ring.c b/deps/uber-graph/g-ring.c
index d865cc15..b014bf74 100644
--- a/deps/uber-graph/g-ring.c
+++ b/deps/uber-graph/g-ring.c
@@ -86,13 +86,13 @@ g_ring_append_vals (GRing *ring,
GRingImpl *ring_impl = (GRingImpl *)ring;
gpointer idx;
gint x;
- gint i;
+ guint i;
g_return_if_fail(ring_impl != NULL);
for (i = 0; i < len; i++) {
- x = ring->pos - i;
- x = (x >= 0) ? x : ring->len + x;
+ x = (int)ring->pos - i;
+ if (x < 0) x += ring->len;
idx = ring->data + (ring_impl->elt_size * x);
if (ring_impl->destroy && ring_impl->looped == TRUE) {
ring_impl->destroy(idx);
@@ -133,7 +133,7 @@ g_ring_foreach (GRing *ring,
for (i = ring_impl->pos - 1; i >= 0; i--) {
func(get_element(ring_impl, i), user_data);
}
- for (i = ring->len - 1; i >= ring_impl->pos; i--) {
+ for (i = ring->len - 1; i >= (int)ring_impl->pos; i--) {
func(get_element(ring_impl, i), user_data);
}
}
diff --git a/deps/uber-graph/uber-line-graph.c b/deps/uber-graph/uber-line-graph.c
index 2e42ed60..776f5363 100644
--- a/deps/uber-graph/uber-line-graph.c
+++ b/deps/uber-graph/uber-line-graph.c
@@ -91,7 +91,7 @@ static inline void
uber_line_graph_init_ring (GRing *ring) /* IN */
{
gdouble val = UBER_LINE_GRAPH_NO_VALUE;
- gint i;
+ guint i;
g_return_if_fail(ring != NULL);
@@ -133,7 +133,7 @@ uber_line_graph_color_changed (UberLabel *label, /* IN */
{
UberLineGraphPrivate *priv;
LineInfo *info;
- gint i;
+ guint i;
g_return_if_fail(UBER_IS_LINE_GRAPH(graph));
g_return_if_fail(color != NULL);
@@ -328,7 +328,7 @@ uber_line_graph_get_next_data (UberGraph *graph) /* IN */
gboolean ret = FALSE;
LineInfo *line;
gdouble val;
- gint i;
+ guint i;
g_return_val_if_fail(UBER_IS_LINE_GRAPH(graph), FALSE);
@@ -458,7 +458,7 @@ uber_line_graph_render_line (UberLineGraph *graph, /* IN */
gdouble y;
gdouble last_y;
gdouble val;
- gint i;
+ guint i;
g_return_if_fail(UBER_IS_LINE_GRAPH(graph));
@@ -482,7 +482,7 @@ uber_line_graph_render_line (UberLineGraph *graph, /* IN */
/*
* Retrieve data point.
*/
- val = g_ring_get_index(line->raw_data, gdouble, i);
+ val = g_ring_get_index(line->raw_data, gdouble, (int)i);
/*
* Once we get to UBER_LINE_GRAPH_NO_VALUE, we must be at the end of the data
* sequence. This may not always be true in the future.
@@ -546,7 +546,7 @@ uber_line_graph_render (UberGraph *graph, /* IN */
{
UberLineGraphPrivate *priv;
LineInfo *line;
- gint i;
+ guint i;
g_return_if_fail(UBER_IS_LINE_GRAPH(graph));
@@ -582,7 +582,7 @@ uber_line_graph_render_fast (UberGraph *graph, /* IN */
LineInfo *line;
gdouble last_y;
gdouble y;
- gint i;
+ guint i;
g_return_if_fail(UBER_IS_LINE_GRAPH(graph));
g_return_if_fail(cr != NULL);
@@ -653,7 +653,7 @@ uber_line_graph_set_stride (UberGraph *graph, /* IN */
{
UberLineGraphPrivate *priv;
LineInfo *line;
- gint i;
+ guint i;
g_return_if_fail(UBER_IS_LINE_GRAPH(graph));
@@ -793,7 +793,7 @@ uber_line_graph_set_line_width (UberLineGraph *graph, /* IN */
g_return_if_fail(UBER_IS_LINE_GRAPH(graph));
g_return_if_fail(line > 0);
- g_return_if_fail(line <= graph->priv->lines->len);
+ g_return_if_fail(line <= (int)graph->priv->lines->len);
info = &g_array_index(graph->priv->lines, LineInfo, line - 1);
info->width = width;
@@ -817,8 +817,8 @@ uber_line_graph_downscale (UberGraph *graph) /* IN */
gdouble val = 0;
gdouble cur;
LineInfo *line;
- gint i;
- gint j;
+ guint i;
+ guint j;
g_return_val_if_fail(UBER_IS_LINE_GRAPH(graph), FALSE);
@@ -835,7 +835,7 @@ uber_line_graph_downscale (UberGraph *graph) /* IN */
for (i = 0; i < priv->lines->len; i++) {
line = &g_array_index(priv->lines, LineInfo, i);
for (j = 0; j < line->raw_data->len; j++) {
- cur = g_ring_get_index(line->raw_data, gdouble, j);
+ cur = g_ring_get_index(line->raw_data, gdouble, (int)j);
val = (cur > val) ? cur : val;
}
}
@@ -867,7 +867,7 @@ uber_line_graph_finalize (GObject *object) /* IN */
{
UberLineGraphPrivate *priv;
LineInfo *line;
- gint i;
+ guint i;
priv = UBER_LINE_GRAPH(object)->priv;
/*
@@ -1019,7 +1019,7 @@ uber_line_graph_clear (UberLineGraph *graph) /* IN */
{
UberLineGraphPrivate *priv = graph->priv;
LineInfo *line;
- gint i;
+ guint i;
for (i = 0; i < priv->lines->len; i++) {
line = &g_array_index(priv->lines, LineInfo, i);
diff --git a/deps/uber-graph/uber-scatter.c b/deps/uber-graph/uber-scatter.c
index 1889cfa8..56c7b00d 100644
--- a/deps/uber-graph/uber-scatter.c
+++ b/deps/uber-graph/uber-scatter.c
@@ -43,7 +43,7 @@ struct _UberScatterPrivate
{
GRing *raw_data;
UberRange range;
- gint stride;
+ guint stride;
GdkRGBA fg_color;
gboolean fg_color_set;
UberScatterFunc func;
@@ -173,8 +173,8 @@ uber_scatter_render (UberGraph *graph, /* IN */
GArray *ar;
gdouble x;
gdouble y;
- gint i;
- gint j;
+ guint i;
+ guint j;
g_return_if_fail(UBER_IS_SCATTER(graph));
@@ -194,7 +194,7 @@ uber_scatter_render (UberGraph *graph, /* IN */
* Retrieve the current data set.
*/
for (i = 0; i < priv->raw_data->len; i++) {
- if (!(ar = g_ring_get_index(priv->raw_data, GArray*, i))) {
+ if (!(ar = g_ring_get_index(priv->raw_data, GArray*, (int)i))) {
continue;
}
x = epoch - (i * each) - (each / 2.);
@@ -244,7 +244,7 @@ uber_scatter_render_fast (UberGraph *graph, /* IN */
GArray *ar;
gdouble x;
gdouble y;
- gint i;
+ guint i;
g_return_if_fail(UBER_IS_SCATTER(graph));
diff --git a/deps/uber-graph/uber-timeout-interval.c b/deps/uber-graph/uber-timeout-interval.c
index 4a4cf52a..baabbcca 100644
--- a/deps/uber-graph/uber-timeout-interval.c
+++ b/deps/uber-graph/uber-timeout-interval.c
@@ -61,7 +61,7 @@ _uber_timeout_interval_prepare (gint64 current_time,
UberTimeoutInterval *interval,
gint *delay)
{
- gint elapsed_time, new_frame_num;
+ guint elapsed_time, new_frame_num;
elapsed_time = _uber_timeout_interval_get_ticks (current_time, interval);
new_frame_num = elapsed_time * interval->fps / 1000;