Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1106)

Side by Side Diff: fpdfsdk/src/javascript/util.cpp

Issue 426763004: Add missing braces for aggregate initializers. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../include/javascript/JavaScript.h" 7 #include "../../include/javascript/JavaScript.h"
8 #include "../../include/javascript/IJavaScript.h" 8 #include "../../include/javascript/IJavaScript.h"
9 #include "../../include/javascript/JS_Define.h" 9 #include "../../include/javascript/JS_Define.h"
10 #include "../../include/javascript/JS_Object.h" 10 #include "../../include/javascript/JS_Object.h"
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 //COleDateTime cppTm(iYear,iMonth+1,iDay,iHour,iMin,iSec); 315 //COleDateTime cppTm(iYear,iMonth+1,iDay,iHour,iMin,iSec);
316 //CString strFormat = cppTm.Format(cFormat.c_str()); 316 //CString strFormat = cppTm.Format(cFormat.c_str());
317 317
318 struct stru_TbConvertAd 318 struct stru_TbConvertAd
319 { 319 {
320 FX_LPCWSTR lpszJSMark; 320 FX_LPCWSTR lpszJSMark;
321 int iValue; 321 int iValue;
322 }; 322 };
323 323
324 stru_TbConvertAd cTableAd[] ={ 324 stru_TbConvertAd cTableAd[] ={
325 » » » (FX_LPCWSTR)L"m", iMonth+1, 325 » » » { (FX_LPCWSTR)L"m", iMonth+1 },
326 » » » » (FX_LPCWSTR)L"d", iDay, 326 » » » { (FX_LPCWSTR)L"d", iDay },
327 » » » » (FX_LPCWSTR)L"H", iHour, 327 » » » { (FX_LPCWSTR)L"H", iHour },
328 » » » » (FX_LPCWSTR)L"h", iHour>12?iHour-12:iHour, 328 » » » { (FX_LPCWSTR)L"h", iHour>12?iHour-12:iHour },
329 » » » » (FX_LPCWSTR)L"M", iMin, 329 » » » { (FX_LPCWSTR)L"M", iMin },
330 » » » » (FX_LPCWSTR)L"s", iSec 330 » » » { (FX_LPCWSTR)L"s", iSec },
331 }; 331 };
332 332
333 //cFormat = strFormat.GetBuffer(strFormat.GetLength()+1); 333 //cFormat = strFormat.GetBuffer(strFormat.GetLength()+1);
334 for(iIndex = 0;iIndex<sizeof(cTableAd)/sizeof(stru_TbConvertAd); iIndex++) 334 for(iIndex = 0;iIndex<sizeof(cTableAd)/sizeof(stru_TbConvertAd); iIndex++)
335 { 335 {
336 wchar_t tszValue[10]; 336 wchar_t tszValue[10];
337 //_itot(cTableAd[iIndex].iValue,tszValue,10); 337 //_itot(cTableAd[iIndex].iValue,tszValue,10);
338 CFX_WideString sValue; 338 CFX_WideString sValue;
339 sValue.Format((FX_LPCWSTR)L"%d",cTableAd[iIndex].iValue) ; 339 sValue.Format((FX_LPCWSTR)L"%d",cTableAd[iIndex].iValue) ;
340 memcpy(tszValue, (wchar_t *)sValue.GetBuffer(sValue.GetL ength()+1), 340 memcpy(tszValue, (wchar_t *)sValue.GetBuffer(sValue.GetL ength()+1),
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 // COleDateTime cppTm(iYear,iMonth+1,iDay,iHour,iMin,iSec); 411 // COleDateTime cppTm(iYear,iMonth+1,iDay,iHour,iMin,iSec);
412 //CString strFormat = cppTm.Format(cFormat.c_str()); 412 //CString strFormat = cppTm.Format(cFormat.c_str());
413 413
414 struct stru_TbConvertAd 414 struct stru_TbConvertAd
415 { 415 {
416 FX_LPCWSTR lpszJSMark; 416 FX_LPCWSTR lpszJSMark;
417 int iValue; 417 int iValue;
418 }; 418 };
419 419
420 stru_TbConvertAd cTableAd[] ={ 420 stru_TbConvertAd cTableAd[] ={
421 » » (FX_LPCWSTR)L"m", iMonth+1, 421 » » { (FX_LPCWSTR)L"m", iMonth+1 },
422 » » » (FX_LPCWSTR)L"d", iDay, 422 » » { (FX_LPCWSTR)L"d", iDay },
423 » » » (FX_LPCWSTR)L"H", iHour, 423 » » { (FX_LPCWSTR)L"H", iHour },
424 » » » (FX_LPCWSTR)L"h", iHour>12?iHour-12:iHour, 424 » » { (FX_LPCWSTR)L"h", iHour>12?iHour-12:iHour },
425 » » » (FX_LPCWSTR)L"M", iMin, 425 » » { (FX_LPCWSTR)L"M", iMin },
426 » » » (FX_LPCWSTR)L"s", iSec 426 » » { (FX_LPCWSTR)L"s", iSec },
427 }; 427 };
428 428
429 //cFormat = strFormat.GetBuffer(strFormat.GetLength()+1); 429 //cFormat = strFormat.GetBuffer(strFormat.GetLength()+1);
430 for(iIndex = 0;iIndex<sizeof(cTableAd)/sizeof(stru_TbConvertAd);iIndex++ ) 430 for(iIndex = 0;iIndex<sizeof(cTableAd)/sizeof(stru_TbConvertAd);iIndex++ )
431 { 431 {
432 wchar_t tszValue[10]; 432 wchar_t tszValue[10];
433 //_itot(cTableAd[iIndex].iValue,tszValue,10); 433 //_itot(cTableAd[iIndex].iValue,tszValue,10);
434 CFX_WideString sValue; 434 CFX_WideString sValue;
435 sValue.Format((FX_LPCWSTR)L"%d",cTableAd[iIndex].iValue); 435 sValue.Format((FX_LPCWSTR)L"%d",cTableAd[iIndex].iValue);
436 memcpy(tszValue, (wchar_t *)sValue.GetBuffer(sValue.GetLength()+ 1),sValue.GetLength()*sizeof(wchar_t)); 436 memcpy(tszValue, (wchar_t *)sValue.GetBuffer(sValue.GetLength()+ 1),sValue.GetLength()*sizeof(wchar_t));
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 int iSize = params.size(); 640 int iSize = params.size();
641 if (iSize == 0) 641 if (iSize == 0)
642 return FALSE; 642 return FALSE;
643 int nByte = (int)params[0]; 643 int nByte = (int)params[0];
644 unsigned char cByte = (unsigned char)nByte; 644 unsigned char cByte = (unsigned char)nByte;
645 CFX_WideString csValue; 645 CFX_WideString csValue;
646 csValue.Format((FX_LPCWSTR)L"%c", cByte); 646 csValue.Format((FX_LPCWSTR)L"%c", cByte);
647 vRet = csValue; 647 vRet = csValue;
648 return TRUE; 648 return TRUE;
649 } 649 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698