[gobject-introspection/fix-msvc-warnings: 3/3] bdz.c: Some cleanups
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection/fix-msvc-warnings: 3/3] bdz.c: Some cleanups
- Date: Fri, 2 Apr 2021 04:41:53 +0000 (UTC)
commit bf19151098ad17b5d969d942309ebcc2a5101b3f
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Fri Apr 2 12:37:47 2021 +0800
bdz.c: Some cleanups
We can just update the for loop condition to be >0 for all builds, which
is actually equivilant to >=1 as we are essentially comparing an
unsigned 32-bit int, so that we don't need to worry about fixing the
VS2012 bug invasively, as Visual Studio 2012 x64 is more sensitive about
sizes of variables (e.g. pointer sizes in this case)
girepository/cmph/bdz.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
---
diff --git a/girepository/cmph/bdz.c b/girepository/cmph/bdz.c
index 34898ad5..e70f1183 100644
--- a/girepository/cmph/bdz.c
+++ b/girepository/cmph/bdz.c
@@ -423,7 +423,7 @@ static void assigning(bdz_config_data_t *bdz, bdz_graph3_t* graph3, bdz_queue_t
memset(marked_vertices, 0, (size_t)(bdz->n >> 3) + 1);
memset(bdz->g, 0xff, (size_t)(sizeg));
- for(i=nedges-1;i+1>=1;i--){
+ for(i=nedges-1;i+1>0;i--){
curr_edge=queue[i];
v0=graph3->edges[curr_edge].vertices[0];
v1=graph3->edges[curr_edge].vertices[1];
@@ -455,14 +455,6 @@ static void assigning(bdz_config_data_t *bdz, bdz_graph3_t* graph3, bdz_queue_t
SETBIT(marked_vertices, v2);
}
DEBUGP("A:%u %u %u -- %u %u %u\n", v0, v1, v2, GETVALUE(bdz->g, v0), GETVALUE(bdz->g, v1),
GETVALUE(bdz->g, v2));
-
-#if (_MSC_VER > 1699 && _MSC_VER < 1800)
- /* This is bad, MSVC 2012 X64 getting confused with the value of i... */
- /* an obvious MSVC 2012 X64 compiler bug :| */
- if (i <= 0)
- break;
-#endif
-
};
free(marked_vertices);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]