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

Side by Side Diff: base/third_party/nspr/prtime.cc

Issue 1218243002: Fix some clang warnings with -Wmissing-braces in base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 5 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 | « base/profiler/stack_sampling_profiler_win.cc ('k') | base/time/time_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Portions are Copyright (C) 2011 Google Inc */ 1 /* Portions are Copyright (C) 2011 Google Inc */
2 /* ***** BEGIN LICENSE BLOCK ***** 2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * 4 *
5 * The contents of this file are subject to the Mozilla Public License Version 5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with 6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at 7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/ 8 * http://www.mozilla.org/MPL/
9 * 9 *
10 * Software distributed under the License is distributed on an "AS IS" basis, 10 * Software distributed under the License is distributed on an "AS IS" basis,
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 *------------------------------------------------------------------------ 100 *------------------------------------------------------------------------
101 */ 101 */
102 PRTime 102 PRTime
103 PR_ImplodeTime(const PRExplodedTime *exploded) 103 PR_ImplodeTime(const PRExplodedTime *exploded)
104 { 104 {
105 // This is important, we want to make sure multiplications are 105 // This is important, we want to make sure multiplications are
106 // done with the correct precision. 106 // done with the correct precision.
107 static const PRTime kSecondsToMicroseconds = static_cast<PRTime>(1000000); 107 static const PRTime kSecondsToMicroseconds = static_cast<PRTime>(1000000);
108 #if defined(OS_WIN) 108 #if defined(OS_WIN)
109 // Create the system struct representing our exploded time. 109 // Create the system struct representing our exploded time.
110 SYSTEMTIME st = {0}; 110 SYSTEMTIME st = {};
111 FILETIME ft = {0}; 111 FILETIME ft = {};
112 ULARGE_INTEGER uli = {0}; 112 ULARGE_INTEGER uli = {};
113 113
114 st.wYear = exploded->tm_year; 114 st.wYear = exploded->tm_year;
115 st.wMonth = static_cast<WORD>(exploded->tm_month + 1); 115 st.wMonth = static_cast<WORD>(exploded->tm_month + 1);
116 st.wDayOfWeek = exploded->tm_wday; 116 st.wDayOfWeek = exploded->tm_wday;
117 st.wDay = static_cast<WORD>(exploded->tm_mday); 117 st.wDay = static_cast<WORD>(exploded->tm_mday);
118 st.wHour = static_cast<WORD>(exploded->tm_hour); 118 st.wHour = static_cast<WORD>(exploded->tm_hour);
119 st.wMinute = static_cast<WORD>(exploded->tm_min); 119 st.wMinute = static_cast<WORD>(exploded->tm_min);
120 st.wSecond = static_cast<WORD>(exploded->tm_sec); 120 st.wSecond = static_cast<WORD>(exploded->tm_sec);
121 st.wMilliseconds = static_cast<WORD>(exploded->tm_usec/1000); 121 st.wMilliseconds = static_cast<WORD>(exploded->tm_usec/1000);
122 // Convert to FILETIME. 122 // Convert to FILETIME.
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 + 60 * localTime.tm_hour 1243 + 60 * localTime.tm_hour
1244 + 1440 * (localTime.tm_mday - 2); 1244 + 1440 * (localTime.tm_mday - 2);
1245 } 1245 }
1246 1246
1247 result->tm_params.tp_gmt_offset = zone_offset * 60; 1247 result->tm_params.tp_gmt_offset = zone_offset * 60;
1248 result->tm_params.tp_dst_offset = dst_offset * 60; 1248 result->tm_params.tp_dst_offset = dst_offset * 60;
1249 1249
1250 *result_imploded = PR_ImplodeTime(result); 1250 *result_imploded = PR_ImplodeTime(result);
1251 return PR_SUCCESS; 1251 return PR_SUCCESS;
1252 } 1252 }
OLDNEW
« no previous file with comments | « base/profiler/stack_sampling_profiler_win.cc ('k') | base/time/time_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698