Commit b791e158 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

use curl_off_t instead of off_t!

parent 6cd0a90b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@
#define SELECT_TYPE_ARG1 int
#define SELECT_TYPE_ARG234 (fd_set *)
#define SELECT_TYPE_ARG5 (struct timeval *)
#define SIZEOF_OFF_T 4
#define SIZEOF_CURL_OFF_T 4

#define STDC_HEADERS 1
#define TIME_WITH_SYS_TIME 1
+1 −1
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ CURLcode Curl_dict(struct connectdata *conn)
  int sockfd = conn->sock[FIRSTSOCKET];

  char *path = conn->path;
  off_t *bytecount = &conn->bytecount;
  curl_off_t *bytecount = &conn->bytecount;

  if(conn->bits.user_passwd) {
    /* AUTH is missing */
+3 −3
Original line number Diff line number Diff line
@@ -211,7 +211,7 @@ CURLcode curl_easy_setopt(CURL *curl, CURLoption tag, ...)
  func_T param_func = (func_T)0;
  long param_long = 0;
  void *param_obj = NULL;
  off_t param_offset = 0;
  curl_off_t param_offset = 0;
  struct SessionHandle *data = curl;
  CURLcode ret=CURLE_FAILED_INIT;

@@ -239,8 +239,8 @@ CURLcode curl_easy_setopt(CURL *curl, CURLoption tag, ...)
    param_func = va_arg(arg, func_T );
    ret = Curl_setopt(data, tag, param_func);
  } else {
    /* This is an off_t type */
    param_offset = va_arg(arg, off_t);
    /* This is a curl_off_t type */
    param_offset = va_arg(arg, curl_off_t);
    ret = Curl_setopt(data, tag, param_offset);
  }

+2 −2
Original line number Diff line number Diff line
@@ -163,12 +163,12 @@ CURLcode Curl_file(struct connectdata *conn)
  */
  CURLcode res = CURLE_OK;
  struct stat statbuf;
  off_t expected_size=0;
  curl_off_t expected_size=0;
  bool fstated=FALSE;
  ssize_t nread;
  struct SessionHandle *data = conn->data;
  char *buf = data->state.buffer;
  off_t bytecount = 0;
  curl_off_t bytecount = 0;
  struct timeval start = Curl_tvnow();
  struct timeval now = start;
  int fd;
+12 −12
Original line number Diff line number Diff line
@@ -921,7 +921,7 @@ static CURLcode ftp_transfertype(struct connectdata *conn,

static
CURLcode ftp_getsize(struct connectdata *conn, char *file,
                      off_t *size)
                     curl_off_t *size)
{
  struct SessionHandle *data = conn->data;
  int ftpcode;
@@ -1660,7 +1660,7 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)

  /* the ftp struct is already inited in Curl_ftp_connect() */
  struct FTP *ftp = conn->proto.ftp;
  off_t *bytecountp = ftp->bytecountp;
  curl_off_t *bytecountp = ftp->bytecountp;

  if(data->set.upload) {

@@ -1692,7 +1692,7 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
      if(conn->resume_from < 0 ) {
        /* we could've got a specified offset from the command line,
           but now we know we didn't */
        off_t gottensize;
        curl_off_t gottensize;

        if(CURLE_OK != ftp_getsize(conn, ftp->file, &gottensize)) {
          failf(data, "Couldn't get remote file size");
@@ -1703,7 +1703,7 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)

      if(conn->resume_from) {
        /* do we still game? */
        off_t passed=0;
        curl_off_t passed=0;
        /* enable append instead */
        data->set.ftp_append = 1;

@@ -1711,8 +1711,8 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
           input. If we knew it was a proper file we could've just
           fseek()ed but we only have a stream here */
        do {
          off_t readthisamountnow = (conn->resume_from - passed);
          off_t actuallyread;
          curl_off_t readthisamountnow = (conn->resume_from - passed);
          curl_off_t actuallyread;

          if(readthisamountnow > BUFSIZE)
            readthisamountnow = BUFSIZE;
@@ -1802,11 +1802,11 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
  else if(!data->set.no_body) {
    /* Retrieve file or directory */
    bool dirlist=FALSE;
    off_t downloadsize=-1;
    curl_off_t downloadsize=-1;

    if(conn->bits.use_range && conn->range) {
      off_t from, to;
      off_t totalsize=-1;
      curl_off_t from, to;
      curl_off_t totalsize=-1;
      char *ptr;
      char *ptr2;

@@ -1863,7 +1863,7 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
            (data->set.ftp_list_only?"NLST":"LIST"));
    }
    else {
      off_t foundsize;
      curl_off_t foundsize;

      /* Set type to binary (unless specified ASCII) */
      result = ftp_transfertype(conn, data->set.ftp_ascii);
@@ -1986,7 +1986,7 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
        E:
        125 Data connection already open; Transfer starting. */

      off_t size=-1; /* default unknown size */
      curl_off_t size=-1; /* default unknown size */


      /*
@@ -2170,7 +2170,7 @@ CURLcode ftp_perform(struct connectdata *conn,
    /* The SIZE command is _not_ RFC 959 specified, and therefor many servers
       may not support it! It is however the only way we have to get a file's
       size! */
    off_t filesize;
    curl_off_t filesize;
    ssize_t nread;
    int ftpcode;

Loading