From 5b2d7b0e4a49cc46a31ba12215fcb2a1691a49fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Thu, 29 Sep 2022 09:45:45 +0800 Subject: Change the weight to long grams --- pikul.c | 4 ++-- pikul.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pikul.c b/pikul.c index 06c2ef2..e725deb 100644 --- a/pikul.c +++ b/pikul.c @@ -292,7 +292,7 @@ static inline long crop_limit(size_t len, char *offset) return strtol(str, NULL, 10); } -char *pikul_shopify(char *origins[], char *destinations[], double weight) +const char *pikul_shopify(char *origins[], char *destinations[], long grams) { struct pikul_service **services[PIKUL_END]; for (enum pikul_company company = PIKUL; company < PIKUL_END; @@ -302,7 +302,7 @@ char *pikul_shopify(char *origins[], char *destinations[], double weight) continue; } services[company] = pikul_services(company, origins[company], - destinations[company], (double)(weight / 1000)); + destinations[company], (double)(grams / 1000)); } static const char *prefix = "{\"rates\":["; const size_t prefix_len = strlen(prefix); diff --git a/pikul.h b/pikul.h index 07504f9..1c16d85 100644 --- a/pikul.h +++ b/pikul.h @@ -25,7 +25,7 @@ void pikul_free_services(struct pikul_service **services); char *pikul_html(char *origins[], char *destinations[], double weight, const char *widget, const char *extra, const char *name, const char *value, char *code_prefixes[], char *name_prefixes[]); -char *pikul_shopify(char *origins[], char *destinations[], double weight); +const char *pikul_shopify(char *origins[], char *destinations[], long grams); double pikul_cost(enum pikul_company company, const char *service, const char *origin, const char *destination, double weight); char *pikul_order(enum pikul_company company, const char *order_number, const char *service, -- cgit v1.2.3