* Bitwise XOR the number stored in number to state and modifies state. */
| 330 | * Bitwise XOR the number stored in number to state and modifies state. |
| 331 | */ |
| 332 | void |
| 333 | BitwiseXorToBsonValue(bson_value_t *state, const bson_value_t *number) |
| 334 | { |
| 335 | if (state->value_type == BSON_TYPE_INT64 || number->value_type == BSON_TYPE_INT64) |
| 336 | { |
| 337 | int64_t result = BsonValueAsInt64(state) ^ BsonValueAsInt64(number); |
| 338 | state->value.v_int64 = result; |
| 339 | state->value_type = BSON_TYPE_INT64; |
| 340 | } |
| 341 | else |
| 342 | { |
| 343 | int32_t result = state->value.v_int32 ^ number->value.v_int32; |
| 344 | state->value.v_int32 = result; |
| 345 | state->value_type = BSON_TYPE_INT32; |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | |
| 350 | /* |
no test coverage detected