Commit 9583b4af authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

examples: fix compiler warnings

parent 8219bc9e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -9,9 +9,12 @@

static size_t wrfu(void *ptr,  size_t  size,  size_t  nmemb,  void *stream)
{
  (void)stream;
  (void)ptr;
  return size * nmemb;
}
int main(int argc, char **argv)

int main(void)
{
  CURL *curl;
  CURLcode res;
+2 −2
Original line number Diff line number Diff line
@@ -28,12 +28,12 @@ void dump(const char *text,
    /* without the hex output, we can fit more on screen */
    width = 0x40;

  fprintf(stream, "%s, %010.10ld bytes (0x%08.8lx)\n",
  fprintf(stream, "%s, %10.10ld bytes (0x%8.8lx)\n",
          text, (long)size, (long)size);

  for(i=0; i<size; i+= width) {

    fprintf(stream, "%04.4lx: ", (long)i);
    fprintf(stream, "%4.4lx: ", (long)i);

    if(!nohex) {
      /* hex not disabled, show it */
+3 −1
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@

static size_t throw_away(void *ptr, size_t size, size_t nmemb, void *data)
{
  (void)ptr;
  (void)data;
  /* we are not interested in the headers itself,
     so we only return the size we would have saved ... */
  return (size_t)(size * nmemb);
@@ -58,7 +60,7 @@ int main(void)
      if((CURLE_OK == res) && filetime)
        printf("filetime %s: %s", filename, ctime(&filetime));
      res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &filesize);
      if((CURLE_OK == res) && filesize)
      if((CURLE_OK == res) && (filesize>0))
        printf("filesize %s: %0.0f bytes\n", filename, filesize);
    } else {
      /* we failed */
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ write_response(void *ptr, size_t size, size_t nmemb, void *data)
  return fwrite(ptr, size, nmemb, writehere);
}

int main(int argc, char **argv)
int main(void)
{
  CURL *curl;
  CURLcode res;
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
  return retcode;
}

int main(int argc, char **argv)
int main(void)
{
  CURL *curl;
  CURLcode res;
Loading