mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 16:10:06 +00:00 
			
		
		
		
	Segment event begin GCC warning fixes
This commit is contained in:
		
							parent
							
								
									45b0df3e0b
								
							
						
					
					
						commit
						bc21d7bf02
					
				
					 1 changed files with 8 additions and 5 deletions
				
			
		|  | @ -130,14 +130,15 @@ TextProductMessage::segment_event_begin(std::size_t s) const | ||||||
|          std::string wmoDateTime = wmo_header()->date_time(); |          std::string wmoDateTime = wmo_header()->date_time(); | ||||||
| 
 | 
 | ||||||
|          bool          wmoDateTimeValid = false; |          bool          wmoDateTimeValid = false; | ||||||
|          unsigned long dayOfMonth       = 0; |          unsigned int  dayOfMonth       = 0; | ||||||
|          unsigned long beginHour        = 0; |          unsigned long beginHour        = 0; | ||||||
|          unsigned long beginMinute      = 0; |          unsigned long beginMinute      = 0; | ||||||
| 
 | 
 | ||||||
|          try |          try | ||||||
|          { |          { | ||||||
|             // WMO date time is in the format DDHHMM
 |             // WMO date time is in the format DDHHMM
 | ||||||
|             dayOfMonth       = std::stoul(wmoDateTime.substr(0, 2)); |             dayOfMonth = | ||||||
|  |                static_cast<unsigned int>(std::stoul(wmoDateTime.substr(0, 2))); | ||||||
|             beginHour        = std::stoul(wmoDateTime.substr(2, 2)); |             beginHour        = std::stoul(wmoDateTime.substr(2, 2)); | ||||||
|             beginMinute      = std::stoul(wmoDateTime.substr(4, 2)); |             beginMinute      = std::stoul(wmoDateTime.substr(4, 2)); | ||||||
|             wmoDateTimeValid = true; |             wmoDateTimeValid = true; | ||||||
|  | @ -162,9 +163,11 @@ TextProductMessage::segment_event_begin(std::size_t s) const | ||||||
|                if (endDate.month() == January) |                if (endDate.month() == January) | ||||||
|                { |                { | ||||||
|                   // The begin month must be December of last year
 |                   // The begin month must be December of last year
 | ||||||
|                   eventBegin = sys_days {year {(endDate.year() - 1y).count()} / |                   eventBegin = | ||||||
|                                          December / day {dayOfMonth}} + |                      sys_days { | ||||||
|                                hours {beginHour} + minutes {beginMinute}; |                         year {static_cast<int>((endDate.year() - 1y).count())} / | ||||||
|  |                         December / day {dayOfMonth}} + | ||||||
|  |                      hours {beginHour} + minutes {beginMinute}; | ||||||
|                } |                } | ||||||
|                else |                else | ||||||
|                { |                { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat