FACT++
1.0
Main Page
Related Pages
Namespaces
Classes
Files
Examples
void Checksum::addLoopSwapping
(
const uint16_t *
sbuf
,
const uint16_t *
end
,
uint32_t *
hilo
)
inline
Definition at line
101
of file
checksum.h
.
Referenced by
add()
.
102
{
103
/*
104
for (size_t i = 0; i < len/2; i++)
105
{
106
//swap the bytes of the 32 bits value. but...
107
//the hi and lo values are stored in fits-like order. do not swap them
108
hilo[i%2] += ntohs(sbuf[i]); //(sbuf[i]&0xff00)>>8 | (sbuf[i]&0x00ff)<<8;
109
}*/
110
111
// This is about as twice as fast as the loop above
112
// ntohs is CPU optimized, i%2 doesn't need to be computed
113
while
(1)
114
{
115
if
(sbuf==
end
)
116
break
;
117
118
hilo[0] += ntohs(*sbuf++);
119
120
if
(sbuf==
end
)
121
break
;
122
123
hilo[1] += ntohs(*sbuf++);
124
}
125
}
end
double end
Definition:
HeadersRateControl.h:88
Here is the caller graph for this function:
Checksum
Generated on Sun Sep 18 2016 20:50:43 for FACT++ by
1.8.11