@matheusbsbs / matheus-bagliano / commits / e8dc37e0e3
Fork 0

Avoid redundant declaration of missing_target()

Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Mike Hommey committed Dec 10, 2007 at 22:36 UTC e8dc37e0e30dbbed532b7471516d1ba5e6e08f27
3 files changed +13 -26
http-walker.c
-13
@@ -90,19 +90,6 @@ static size_t fwrite_sha1_file(void *ptr, size_t eltsize, size_t nmemb,
90 return size;
91 }
92
93 -static int missing__target(int code, int result)
94 -{
95 - return /* file:// URL -- do we ever use one??? */
96 - (result == CURLE_FILE_COULDNT_READ_FILE) ||
97 - /* http:// and https:// URL */
98 - (code == 404 && result == CURLE_HTTP_RETURNED_ERROR) ||
99 - /* ftp:// URL */
100 - (code == 550 && result == CURLE_FTP_COULDNT_RETR_FILE)
101 - ;
102 -}
103 -
104 -#define missing_target(a) missing__target((a)->http_code, (a)->curl_result)
105 -
93 static void fetch_alternates(struct walker *walker, const char *base);
94
95 static void process_object_response(void *callback_data);
http.h
+13
@@ -82,4 +82,17 @@ extern int active_requests;
82
83 extern char curl_errorstr[CURL_ERROR_SIZE];
84
85 +static inline int missing__target(int code, int result)
86 +{
87 + return /* file:// URL -- do we ever use one??? */
88 + (result == CURLE_FILE_COULDNT_READ_FILE) ||
89 + /* http:// and https:// URL */
90 + (code == 404 && result == CURLE_HTTP_RETURNED_ERROR) ||
91 + /* ftp:// URL */
92 + (code == 550 && result == CURLE_FTP_COULDNT_RETR_FILE)
93 + ;
94 +}
95 +
96 +#define missing_target(a) missing__target((a)->http_code, (a)->curl_result)
97 +
98 #endif /* HTTP_H */
transport.c
-13
@@ -426,19 +426,6 @@ static int curl_transport_push(struct transport *transport, int refspec_nr, cons
426 return !!err;
427 }
428
429 -static int missing__target(int code, int result)
430 -{
431 - return /* file:// URL -- do we ever use one??? */
432 - (result == CURLE_FILE_COULDNT_READ_FILE) ||
433 - /* http:// and https:// URL */
434 - (code == 404 && result == CURLE_HTTP_RETURNED_ERROR) ||
435 - /* ftp:// URL */
436 - (code == 550 && result == CURLE_FTP_COULDNT_RETR_FILE)
437 - ;
438 -}
439 -
440 -#define missing_target(a) missing__target((a)->http_code, (a)->curl_result)
441 -
429 static struct ref *get_refs_via_curl(struct transport *transport)
430 {
431 struct buffer buffer;