Input Argument Helper */ Take a pointer to the latitude arg then use the next arg for longitude. * On parse error C_ERR is returned, otherwise C_OK. */
| 92 | /* Take a pointer to the latitude arg then use the next arg for longitude. |
| 93 | * On parse error C_ERR is returned, otherwise C_OK. */ |
| 94 | int extractLongLatOrReply(client *c, robj **argv, double *xy) { |
| 95 | int i; |
| 96 | for (i = 0; i < 2; i++) { |
| 97 | if (getDoubleFromObjectOrReply(c, argv[i], xy + i, NULL) != |
| 98 | C_OK) { |
| 99 | return C_ERR; |
| 100 | } |
| 101 | } |
| 102 | if (xy[0] < GEO_LONG_MIN || xy[0] > GEO_LONG_MAX || |
| 103 | xy[1] < GEO_LAT_MIN || xy[1] > GEO_LAT_MAX) { |
| 104 | addReplyErrorFormat(c, |
| 105 | "-ERR invalid longitude,latitude pair %f,%f\r\n",xy[0],xy[1]); |
| 106 | return C_ERR; |
| 107 | } |
| 108 | return C_OK; |
| 109 | } |
| 110 | |
| 111 | /* Input Argument Helper */ |
| 112 | /* Decode lat/long from a zset member's score. |
no test coverage detected