- switch (pszFormat[++n]) {
- case _T('\0'):
- done = TRUE;
- break;
- case _T('%'):
- *this += _T('%');
- done = TRUE;
- break;
- case _T('#'):
- case _T('0'):
- case _T(' '):
- case _T('+'):
- case _T('\''):
- CHECK_PREC
- s_szFlags[flagofs++] = pszFormat[n];
- break;
- case _T('-'):
- CHECK_PREC
- adj_left = TRUE;
- s_szFlags[flagofs++] = pszFormat[n];
- break;
- case _T('.'):
- CHECK_PREC
- in_prec = TRUE;
- prec_dot = FALSE;
- max_width = 0;
- // dot will be auto-added to s_szFlags if non-negative number follows
- break;
- case _T('h'):
- ilen = -1;
- CHECK_PREC
- s_szFlags[flagofs++] = pszFormat[n];
- break;
- case _T('l'):
- ilen = 1;
- CHECK_PREC
- s_szFlags[flagofs++] = pszFormat[n];
- break;
- case _T('q'):
- case _T('L'):
- ilen = 2;
- CHECK_PREC
- s_szFlags[flagofs++] = pszFormat[n];
- break;
- case _T('Z'):
- ilen = 3;
- CHECK_PREC
- s_szFlags[flagofs++] = pszFormat[n];
- break;
- case _T('*'):
- {
- int len = va_arg(argptr, int);
- if (in_prec) {
- if (len<0) break;
- CHECK_PREC
- max_width = len;
- } else {
- if (len<0) {
- adj_left = !adj_left;
- s_szFlags[flagofs++] = '-';
- len = -len;
- }
- min_width = len;
- }
- flagofs += ::sprintf(s_szFlags+flagofs,"%d",len);
- }
- break;
- case _T('1'): case _T('2'): case _T('3'):
- case _T('4'): case _T('5'): case _T('6'):
- case _T('7'): case _T('8'): case _T('9'):
- {
- int len = 0;
- CHECK_PREC
- while ((pszFormat[n]>=_T('0')) && (pszFormat[n]<=_T('9'))) {
- s_szFlags[flagofs++] = pszFormat[n];
- len = len*10 + (pszFormat[n] - _T('0'));
- n++;
- }
- if (in_prec) max_width = len;
- else min_width = len;
- n--; // the main loop pre-increments n again
- }
- break;
- case _T('d'):
- case _T('i'):
- case _T('o'):
- case _T('u'):
- case _T('x'):
- case _T('X'):
- CHECK_PREC
- s_szFlags[flagofs++] = pszFormat[n];
- s_szFlags[flagofs] = '\0';
- if (ilen == 0 ) {
- int val = va_arg(argptr, int);
- ::sprintf(s_szScratch, s_szFlags, val);
- }
- else if (ilen == -1) {
- short int val = va_arg(argptr, short int);
- ::sprintf(s_szScratch, s_szFlags, val);
- }
- else if (ilen == 1) {
- long int val = va_arg(argptr, long int);
- ::sprintf(s_szScratch, s_szFlags, val);
- }
- else if (ilen == 2) {
+ switch (pszFormat[++n]) {
+ case wxT('\0'):
+ done = TRUE;
+ break;
+ case wxT('%'):
+ *this += wxT('%');
+ done = TRUE;
+ break;
+ case wxT('#'):
+ case wxT('0'):
+ case wxT(' '):
+ case wxT('+'):
+ case wxT('\''):
+ CHECK_PREC
+ s_szFlags[flagofs++] = pszFormat[n];
+ break;
+ case wxT('-'):
+ CHECK_PREC
+ adj_left = TRUE;
+ s_szFlags[flagofs++] = pszFormat[n];
+ break;
+ case wxT('.'):
+ CHECK_PREC
+ in_prec = TRUE;
+ prec_dot = FALSE;
+ max_width = 0;
+ // dot will be auto-added to s_szFlags if non-negative number follows
+ break;
+ case wxT('h'):
+ ilen = -1;
+ CHECK_PREC
+ s_szFlags[flagofs++] = pszFormat[n];
+ break;
+ case wxT('l'):
+ ilen = 1;
+ CHECK_PREC
+ s_szFlags[flagofs++] = pszFormat[n];
+ break;
+ case wxT('q'):
+ case wxT('L'):
+ ilen = 2;
+ CHECK_PREC
+ s_szFlags[flagofs++] = pszFormat[n];
+ break;
+ case wxT('Z'):
+ ilen = 3;
+ CHECK_PREC
+ s_szFlags[flagofs++] = pszFormat[n];
+ break;
+ case wxT('*'):
+ {
+ int len = va_arg(argptr, int);
+ if (in_prec) {
+ if (len<0) break;
+ CHECK_PREC
+ max_width = len;
+ } else {
+ if (len<0) {
+ adj_left = !adj_left;
+ s_szFlags[flagofs++] = '-';
+ len = -len;
+ }
+ min_width = len;
+ }
+ flagofs += ::sprintf(s_szFlags+flagofs,"%d",len);
+ }
+ break;
+ case wxT('1'): case wxT('2'): case wxT('3'):
+ case wxT('4'): case wxT('5'): case wxT('6'):
+ case wxT('7'): case wxT('8'): case wxT('9'):
+ {
+ int len = 0;
+ CHECK_PREC
+ while ((pszFormat[n]>=wxT('0')) && (pszFormat[n]<=wxT('9'))) {
+ s_szFlags[flagofs++] = pszFormat[n];
+ len = len*10 + (pszFormat[n] - wxT('0'));
+ n++;
+ }
+ if (in_prec) max_width = len;
+ else min_width = len;
+ n--; // the main loop pre-increments n again
+ }
+ break;
+ case wxT('d'):
+ case wxT('i'):
+ case wxT('o'):
+ case wxT('u'):
+ case wxT('x'):
+ case wxT('X'):
+ CHECK_PREC
+ s_szFlags[flagofs++] = pszFormat[n];
+ s_szFlags[flagofs] = '\0';
+ if (ilen == 0 ) {
+ int val = va_arg(argptr, int);
+ ::sprintf(szScratch, s_szFlags, val);
+ }
+ else if (ilen == -1) {
+ short int val = va_arg(argptr, short int);
+ ::sprintf(szScratch, s_szFlags, val);
+ }
+ else if (ilen == 1) {
+ long int val = va_arg(argptr, long int);
+ ::sprintf(szScratch, s_szFlags, val);
+ }
+ else if (ilen == 2) {