Skip to content

Commit

Permalink
Remove int cast to avoid warnings on 32-bit platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
alcaeus committed Jul 25, 2024
1 parent 1cd5d03 commit 3cd0d11
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/cursor/cursor-session-001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ $iterator = new IteratorIterator($cursor);
$iterator->rewind();
$iterator->next();

printf("Cursor ID is zero: %s\n", (int) $cursor->getId(true) === 0 ? 'yes' : 'no');
printf("Cursor ID is zero: %s\n", $cursor->getId(true) == 0 ? 'yes' : 'no');
var_dump($cursor);

$iterator->next();
Expand All @@ -35,7 +35,7 @@ $iterator->next();
* is exhausted. While this is primarily done to ensure implicit sessions for
* command cursors are returned to the pool ASAP, it also applies to explicit
* sessions. */
printf("\nCursor ID is zero: %s\n", (int) $cursor->getId(true) === 0 ? 'yes' : 'no');
printf("\nCursor ID is zero: %s\n", $cursor->getId(true) == 0 ? 'yes' : 'no');
var_dump($cursor);

?>
Expand Down
4 changes: 2 additions & 2 deletions tests/cursor/cursor-session-002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ $iterator->next();
/* Implicit sessions for query cursors are never exposed to PHPC, as they are
* handled internally by libmongoc. Cursor debug ouput should never report such
* sessions. */
printf("Cursor ID is zero: %s\n", (int) $cursor->getId(true) === 0 ? 'yes' : 'no');
printf("Cursor ID is zero: %s\n", $cursor->getId(true) == 0 ? 'yes' : 'no');
var_dump($cursor);

$iterator->next();

printf("\nCursor ID is zero: %s\n", (int) $cursor->getId(true) === 0 ? 'yes' : 'no');
printf("\nCursor ID is zero: %s\n", $cursor->getId(true) == 0 ? 'yes' : 'no');
var_dump($cursor);

?>
Expand Down
4 changes: 2 additions & 2 deletions tests/cursor/cursor-session-003.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $iterator = new IteratorIterator($cursor);
$iterator->rewind();
$iterator->next();

printf("Cursor ID is zero: %s\n", (int) $cursor->getId(true) === 0 ? 'yes' : 'no');
printf("Cursor ID is zero: %s\n", $cursor->getId(true) == 0 ? 'yes' : 'no');
var_dump($cursor);

$iterator->next();
Expand All @@ -39,7 +39,7 @@ $iterator->next();
* is exhausted. While this is primarily done to ensure implicit sessions for
* command cursors are returned to the pool ASAP, it also applies to explicit
* sessions. */
printf("\nCursor ID is zero: %s\n", (int) $cursor->getId(true) === 0 ? 'yes' : 'no');
printf("\nCursor ID is zero: %s\n", $cursor->getId(true) == 0 ? 'yes' : 'no');
var_dump($cursor);

?>
Expand Down
4 changes: 2 additions & 2 deletions tests/cursor/cursor-session-004.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ $iterator = new IteratorIterator($cursor);
$iterator->rewind();
$iterator->next();

printf("Cursor ID is zero: %s\n", (int) $cursor->getId(true) === 0 ? 'yes' : 'no');
printf("Cursor ID is zero: %s\n", $cursor->getId(true) == 0 ? 'yes' : 'no');
var_dump($cursor);

$iterator->next();
Expand All @@ -38,7 +38,7 @@ $iterator->next();
* libmongoc, PHPC-1152 emulates its own implicit sessions for command cursors
* in order to ensure that command cursors always share the same session as the
* originating command. */
printf("\nCursor ID is zero: %s\n", (int) $cursor->getId(true) === 0 ? 'yes' : 'no');
printf("\nCursor ID is zero: %s\n", $cursor->getId(true) == 0 ? 'yes' : 'no');
var_dump($cursor);

?>
Expand Down

0 comments on commit 3cd0d11

Please sign in to comment.