Skip to content

Commit 8c6e3d7

Browse files
authored
fix missing parentheses in compare-and-exchange pseudocode (#769)
Also adds curly braces, which generates slightly better syntax highlighting.
1 parent ff2c131 commit 8c6e3d7

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

OpenCL_C.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7330,10 +7330,11 @@ The effect of the compare-and-exchange operations is
73307330

73317331
[source,opencl_c]
73327332
----------
7333-
if (memcmp(object, expected, sizeof(*object) == 0)
7333+
if (memcmp(object, expected, sizeof(*object)) == 0) {
73347334
memcpy(object, &desired, sizeof(*object));
7335-
else
7335+
} else {
73367336
memcpy(expected, object, sizeof(*object));
7337+
}
73377338
----------
73387339
====
73397340

0 commit comments

Comments
 (0)