OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2007 INRIA | 3 * Copyright (c) 2007 INRIA |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 | 271 |
272 std::string::size_type col = 0; | 272 std::string::size_type col = 0; |
273 for (uint8_t i = 0; i < 6; ++i) | 273 for (uint8_t i = 0; i < 6; ++i) |
274 { | 274 { |
275 std::string tmp; | 275 std::string tmp; |
276 std::string::size_type next; | 276 std::string::size_type next; |
277 next = v.find (":", col); | 277 next = v.find (":", col); |
278 if (next == std::string::npos) | 278 if (next == std::string::npos) |
279 { | 279 { |
280 tmp = v.substr (col, v.size ()-col); | 280 tmp = v.substr (col, v.size ()-col); |
281 address.m_address[i] = strtoul (tmp.c_str(), 0, 16); | 281 address.m_address[i] = static_cast<uint8_t> (strtoul (tmp.c_str(), 0,
16)); |
282 break; | 282 break; |
283 } | 283 } |
284 else | 284 else |
285 { | 285 { |
286 tmp = v.substr (col, next-col); | 286 tmp = v.substr (col, next-col); |
287 address.m_address[i] = strtoul (tmp.c_str(), 0, 16); | 287 address.m_address[i] = static_cast<uint8_t> (strtoul (tmp.c_str(), 0,
16)); |
288 col = next + 1; | 288 col = next + 1; |
289 } | 289 } |
290 } | 290 } |
291 return is; | 291 return is; |
292 } | 292 } |
293 | 293 |
294 | 294 |
295 } // namespace ns3 | 295 } // namespace ns3 |
OLD | NEW |