We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61bde39 commit a6f6d9eCopy full SHA for a6f6d9e
chapters/computational_geometry/gift_wrapping/graham_scan/code/c/graham.c
@@ -10,9 +10,12 @@ struct point {
10
};
11
12
int cmp_points(const void *a, const void *b) {
13
- if (((struct point*)a)->y > ((struct point*)b)->y) {
+ struct point* pa = (struct point*) a;
14
+ struct point* pb = (struct point*) b;
15
+
16
+ if (pa->y > pb->y) {
17
return 1;
- } else if (((struct point*)a)->y < ((struct point*)b)->y) {
18
+ } else if (pa->y < pb->y) {
19
return -1;
20
} else {
21
return 0;
0 commit comments