Changeset 16563 for trunk/Mars/mcore
- Timestamp:
- 06/01/13 22:08:31 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mcore/checksum.h
r16546 r16563 1 1 #ifndef MARS_checksum 2 2 #define MARS_checksum 3 4 #include <arpa/inet.h>5 3 6 4 namespace std … … 67 65 } 68 66 69 const uint 32_t *sbuf = reinterpret_cast<const uint32_t*>(buf);67 const uint16_t *sbuf = reinterpret_cast<const uint16_t *>(buf); 70 68 71 69 uint32_t *hilo = reinterpret_cast<uint32_t*>(&buffer); … … 84 82 while (1) 85 83 { 84 if (sbuf==end) 85 break; 86 86 87 hilo[0] += ntohs(*sbuf++); 88 87 89 if (sbuf==end) 88 90 break; 89 91 90 92 hilo[1] += ntohs(*sbuf++); 91 if (sbuf==end)92 break;93 93 } 94 94
Note:
See TracChangeset
for help on using the changeset viewer.