* Bitwise AND the number stored in number to state and modifies state. */
| 288 | * Bitwise AND the number stored in number to state and modifies state. |
| 289 | */ |
| 290 | void |
| 291 | BitwiseAndToBsonValue(bson_value_t *state, const bson_value_t *number) |
| 292 | { |
| 293 | if (state->value_type == BSON_TYPE_INT64 || number->value_type == BSON_TYPE_INT64) |
| 294 | { |
| 295 | int64_t result = BsonValueAsInt64(state) & BsonValueAsInt64(number); |
| 296 | state->value.v_int64 = result; |
| 297 | state->value_type = BSON_TYPE_INT64; |
| 298 | } |
| 299 | else |
| 300 | { |
| 301 | int32_t result = state->value.v_int32 & number->value.v_int32; |
| 302 | state->value.v_int32 = result; |
| 303 | state->value_type = BSON_TYPE_INT32; |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | |
| 308 | /* |
no test coverage detected