~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_getopt.cc

  • Committer: Brian Aker
  • Date: 2009-03-05 08:26:07 UTC
  • mfrom: (910.2.11 mordred-noatomics)
  • Revision ID: brian@tangent.org-20090305082607-30deookk6sdycdeb
Merge from Monty.

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);
912
915
    }
913
916
    break;
914
917
  default:
915
 
    assert((optp->var_type & GET_TYPE_MASK) == GET_ULL);
 
918
    assert(((optp->var_type & GET_TYPE_MASK) == GET_ULL)
 
919
           || ((optp->var_type & GET_TYPE_MASK) == GET_UINT64));
916
920
    break;
917
921
  }
918
922
 
996
1000
  case GET_LONG:
997
1001
    *((long*) variable)= (long) value;
998
1002
    break;
999
 
  case GET_ULONG:
 
1003
  case GET_UINT32:
1000
1004
    *((uint32_t*) variable)= (uint32_t) value;
1001
1005
    break;
 
1006
  case GET_ULONG_IS_FAIL:
 
1007
    *((ulong*) variable)= (ulong) value;
 
1008
    break;
1002
1009
  case GET_LL:
1003
1010
    *((int64_t*) variable)= (int64_t) value;
1004
1011
    break;
1005
1012
  case GET_SIZE:
1006
1013
    *((size_t*) variable)= (size_t) value;
 
1014
    break;
1007
1015
  case GET_ULL:
1008
1016
  case GET_SET:
 
1017
  case GET_UINT64:
1009
1018
    *((uint64_t*) variable)=  (uint64_t) value;
1010
1019
    break;
1011
1020
  case GET_DOUBLE:
1253
1262
      case GET_LONG:
1254
1263
        printf("%ld\n", *((long*) value));
1255
1264
        break;
1256
 
      case GET_ULONG:
 
1265
      case GET_UINT32:
1257
1266
        printf("%u\n", *((uint32_t*) value));
1258
1267
        break;
 
1268
      case GET_ULONG_IS_FAIL:
 
1269
        printf("%lu\n", *((ulong*) value));
 
1270
        break;
1259
1271
      case GET_SIZE:
1260
1272
        cout << value;
1261
1273
        break;
1263
1275
        printf("%s\n", llstr(*((int64_t*) value), buff));
1264
1276
        break;
1265
1277
      case GET_ULL:
 
1278
      case GET_UINT64:
1266
1279
        int64_t2str(*((uint64_t*) value), buff, 10);
1267
1280
        printf("%s\n", buff);
1268
1281
        break;