~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_getopt.cc

  • Committer: Stewart Smith
  • Date: 2009-03-04 22:49:53 UTC
  • mto: (910.4.2 sparc) (908.3.6 work)
  • mto: This revision was merged to the branch mainline in revision 912.
  • Revision ID: stewart@flamingspork.com-20090304224953-b2ow237kc1bkp0o0
for getopt, replace GET_ULONG with GET_UINT32.

Don't replace for sql variables (yet). instead just indicated the intense source of fail with GET_ULONG_IS_FAIL.

Show diffs side-by-side

added added

removed removed

Lines of Context:
616
616
      *((int32_t*) result_pos)= (int) getopt_ll(argument, opts, &err);
617
617
      break;
618
618
    case GET_UINT:
 
619
    case GET_UINT32:
619
620
      *((uint32_t*) result_pos)= (uint32_t) getopt_ull(argument, opts, &err);
620
621
      break;
 
622
    case GET_ULONG_IS_FAIL:
 
623
      *((ulong*) result_pos)= (ulong) getopt_ull(argument, opts, &err);
 
624
      break;
621
625
    case GET_LONG:
622
626
      *((long*) result_pos)= (long) getopt_ll(argument, opts, &err);
623
627
      break;
624
 
    case GET_ULONG:
625
 
      *((long*) result_pos)= (long) getopt_ull(argument, opts, &err);
626
 
      break;
627
628
    case GET_LL:
628
629
      *((int64_t*) result_pos)= getopt_ll(argument, opts, &err);
629
630
      break;
630
631
    case GET_ULL:
 
632
    case GET_UINT64:
631
633
      *((uint64_t*) result_pos)= getopt_ull(argument, opts, &err);
632
634
      break;
633
635
    case GET_SIZE:
897
899
      adjusted= true;
898
900
    }
899
901
    break;
900
 
  case GET_ULONG:
 
902
  case GET_UINT32:
 
903
  case GET_ULONG_IS_FAIL:
901
904
    if (num > (uint64_t) UINT32_MAX)
902
905
    {
903
906
      num= ((uint64_t) UINT32_MAX);
996
999
  case GET_LONG:
997
1000
    *((long*) variable)= (long) value;
998
1001
    break;
999
 
  case GET_ULONG:
 
1002
  case GET_UINT32:
1000
1003
    *((uint32_t*) variable)= (uint32_t) value;
1001
1004
    break;
 
1005
  case GET_ULONG_IS_FAIL:
 
1006
    *((ulong*) variable)= (ulong) value;
 
1007
    break;
1002
1008
  case GET_LL:
1003
1009
    *((int64_t*) variable)= (int64_t) value;
1004
1010
    break;
1006
1012
    *((size_t*) variable)= (size_t) value;
1007
1013
  case GET_ULL:
1008
1014
  case GET_SET:
 
1015
  case GET_UINT64:
1009
1016
    *((uint64_t*) variable)=  (uint64_t) value;
1010
1017
    break;
1011
1018
  case GET_DOUBLE:
1253
1260
      case GET_LONG:
1254
1261
        printf("%ld\n", *((long*) value));
1255
1262
        break;
1256
 
      case GET_ULONG:
 
1263
      case GET_UINT32:
1257
1264
        printf("%u\n", *((uint32_t*) value));
1258
1265
        break;
 
1266
      case GET_ULONG_IS_FAIL:
 
1267
        printf("%lu\n", *((ulong*) value));
 
1268
        break;
1259
1269
      case GET_SIZE:
1260
1270
        cout << value;
1261
1271
        break;
1263
1273
        printf("%s\n", llstr(*((int64_t*) value), buff));
1264
1274
        break;
1265
1275
      case GET_ULL:
 
1276
      case GET_UINT64:
1266
1277
        int64_t2str(*((uint64_t*) value), buff, 10);
1267
1278
        printf("%s\n", buff);
1268
1279
        break;