~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/drizzle.c

  • Committer: Brian Aker
  • Date: 2008-09-16 09:41:23 UTC
  • Revision ID: brian@gir.lan-20080916094123-2ws792vn896n2g53
Fixed uint/ushort issue in libdrizzle

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
 
108
108
#if DRIZZLE_PORT_DEFAULT == 0
109
109
        if ((serv_ptr = getservbyname("drizzle", "tcp")))
110
 
          drizzle_set_default_port((uint) ntohs((ushort) serv_ptr->s_port));
 
110
          drizzle_set_default_port((uint32_t) ntohs((uint16_t) serv_ptr->s_port));
111
111
#endif
112
112
        if ((env = getenv("DRIZZLE_TCP_PORT")))
113
 
          drizzle_set_default_port((uint) atoi(env));
 
113
          drizzle_set_default_port((uint32_t) atoi(env));
114
114
      }
115
115
    }
116
116
#if defined(SIGPIPE)
363
363
  strncpy(drizzle->scramble, end, SCRAMBLE_LENGTH_323);
364
364
  end+= SCRAMBLE_LENGTH_323+1;
365
365
 
366
 
  if (pkt_length >= (uint) (end+1 - (char*) net->read_pos))
 
366
  if (pkt_length >= (uint32_t) (end+1 - (char*) net->read_pos))
367
367
    drizzle->server_capabilities=uint2korr(end);
368
 
  if (pkt_length >= (uint) (end+18 - (char*) net->read_pos))
 
368
  if (pkt_length >= (uint32_t) (end+18 - (char*) net->read_pos))
369
369
  {
370
370
    /* New protocol with 16 bytes to describe server characteristics */
371
371
    drizzle->server_language=end[2];
372
372
    drizzle->server_status=uint2korr(end+3);
373
373
  }
374
374
  end+= 18;
375
 
  if (pkt_length >= (uint) (end + SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323 + 1 -
 
375
  if (pkt_length >= (uint32_t) (end + SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323 + 1 -
376
376
                            (char *) net->read_pos))
377
377
    strncpy(drizzle->scramble+SCRAMBLE_LENGTH_323, end,
378
378
            SCRAMBLE_LENGTH-SCRAMBLE_LENGTH_323);
695
695
 
696
696
  if (!(fields=cli_read_rows(drizzle,(DRIZZLE_FIELD*)0, 7)))
697
697
    return(1);
698
 
  if (!(drizzle->fields= unpack_fields(fields, (uint) field_count, 0)))
 
698
  if (!(drizzle->fields= unpack_fields(fields, (uint32_t) field_count, 0)))
699
699
    return(1);
700
700
  drizzle->status= DRIZZLE_STATUS_GET_RESULT;
701
 
  drizzle->field_count= (uint) field_count;
 
701
  drizzle->field_count= (uint32_t) field_count;
702
702
  return(0);
703
703
}
704
704
 
742
742
    return(0);
743
743
  }
744
744
  drizzle->status=DRIZZLE_STATUS_READY;    /* server is ready */
745
 
  if (!(result=(DRIZZLE_RES*) malloc((uint) (sizeof(DRIZZLE_RES)+
 
745
  if (!(result=(DRIZZLE_RES*) malloc((uint32_t) (sizeof(DRIZZLE_RES)+
746
746
                sizeof(uint32_t) *
747
747
                drizzle->field_count))))
748
748
  {