* Appends the given value as an int32 or double if the former would result in overflow. */
| 915 | * Appends the given value as an int32 or double if the former would result in overflow. |
| 916 | */ |
| 917 | void |
| 918 | PgbsonWriterAppendInt32OrDouble(pgbson_writer *writer, const char *path, uint32_t |
| 919 | pathLength, int64 value) |
| 920 | { |
| 921 | if (value >= INT32_MIN && value <= INT32_MAX) |
| 922 | { |
| 923 | PgbsonWriterAppendInt32(writer, path, pathLength, (int) value); |
| 924 | } |
| 925 | else |
| 926 | { |
| 927 | PgbsonWriterAppendDouble(writer, path, pathLength, value); |
| 928 | } |
| 929 | } |
| 930 | |
| 931 | |
| 932 | /* |
no test coverage detected