~linuxjedi/libdrizzle/5.1-tests

« back to all changes in this revision

Viewing changes to libdrizzle/column.cc

  • Committer: Andrew Hutchings
  • Date: 2012-12-19 12:44:26 UTC
  • mfrom: (50.1.2 libdrizzle-5.1)
  • Revision ID: andrew@linuxjedi.co.uk-20121219124426-8fk29z8u5p24inly
Merge in C++ compiling

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
    return NULL;
57
57
  }
58
58
 
59
 
  column= malloc(sizeof(drizzle_column_st));
 
59
  column= (drizzle_column_st*)malloc(sizeof(drizzle_column_st));
60
60
  if (column == NULL)
61
61
  {
62
62
    drizzle_set_error(result->con->drizzle, __func__, "Failed to allocate.");
75
75
  column->charset = 0;
76
76
  column->size = 0;
77
77
  column->max_size = 0;
78
 
  column->type = 0;
 
78
  column->type= (drizzle_column_type_t)0;
79
79
  column->flags = 0;
80
80
  column->decimals = 0;
81
81
  /* UNSET: column->default_value */
215
215
{
216
216
  if (column == NULL)
217
217
  {
218
 
    return 0;
 
218
    return DRIZZLE_COLUMN_TYPE_DECIMAL;
219
219
  }
220
220
 
221
221
  return column->type;
225
225
{
226
226
  if (column == NULL)
227
227
  {
228
 
    return 0;
 
228
    return DRIZZLE_COLUMN_FLAGS_NONE;
229
229
  }
230
230
 
231
 
  return column->flags;
 
231
  return drizzle_column_flags_t(column->flags);
232
232
}
233
233
 
234
234
uint8_t drizzle_column_decimals(drizzle_column_st *column)
340
340
      return DRIZZLE_RETURN_OK;
341
341
    }
342
342
 
343
 
    result->column_buffer= calloc(result->column_count, sizeof(drizzle_column_st));
 
343
    result->column_buffer= (drizzle_column_st*)calloc(result->column_count, sizeof(drizzle_column_st));
344
344
    if (result->column_buffer == NULL)
345
345
    {
346
346
      drizzle_set_error(result->con->drizzle, __func__, "Failed to allocate.");
498
498
    /* EOF packet marking end of columns. */
499
499
    con->result->column= NULL;
500
500
    con->result->warning_count= drizzle_get_byte2(con->buffer_ptr + 1);
501
 
    con->status= drizzle_get_byte2(con->buffer_ptr + 3);
 
501
    con->status= drizzle_con_status_t(drizzle_get_byte2(con->buffer_ptr + 3));
502
502
    con->buffer_ptr+= 5;
503
503
    con->buffer_size-= 5;
504
504
 
537
537
    column->charset= (drizzle_charset_t)drizzle_get_byte2(con->buffer_ptr + 1);
538
538
    column->size= drizzle_get_byte4(con->buffer_ptr + 3);
539
539
 
540
 
    column->type= con->buffer_ptr[7];
 
540
    column->type= drizzle_column_type_t(con->buffer_ptr[7]);
541
541
 
542
542
    column->flags= drizzle_get_byte2(con->buffer_ptr + 8);
543
543
    if (column->type <= DRIZZLE_COLUMN_TYPE_INT24 &&