C语言程序代码的解读

在VC++6.0中,我的程序无法实现,老是报错,不知道是少了些什么。另外这种代码应该怎么去解读啊,不太看得懂。
uint16 GenCpChecksum16(uint8* pBuffer, uint32 nNumBytes)

{
uint32 nChecksum = 0;
uint16 nCurVal;
uint32 nByteCounter;
uint32 nNumBytesEven = nNumBytes & ~(sizeof(uint16) ‐ 1);
// for reasons of performance, this function is limited to
64Kb length.
// Since the GenCP standard recommends to have
packets <= 1Kb, this should not be a problem.
assert(nNumBytes < 65535);

for (nByteCounter = 0; nByteCounter < nNumBytesEven; nByteCounter += sizeof(uint16))
{
// pBuffer is interpreted as an array of big endian
16 bit values.
nCurVal = (((uint16) pBuffer[nByteCounter]) << 8) | ((uint16) pBuffer[nByteCounter + 1]);
nChecksum += (uint32) nCurVal;
}

if ((nNumBytes & (sizeof(uint16) ‐ 1)) != 0)
{
// special case: buffer length is odd number
nChecksum += (((uint32) pBuffer[nNumBytesEven]) << 8);
}
while ((nChecksum & 0x4F0000) != 0)
{
nChecksum = (nChecksum & 0x4F) + (nChecksum >> 16);
return(~((uint16) nChecksum));
}

报错

E:\VC\Microsoft Visual Studio\MyProjects\1\2.cpp(1) : error C2146: syntax error : missing ';' before identifier 'GenCpChecksum16'
E:\VC\Microsoft Visual Studio\MyProjects\1\2.cpp(1) : error C2501: 'uint16' : missing storage-class or type specifiers
E:\VC\Microsoft Visual Studio\MyProjects\1\2.cpp(1) : fatal error C1004: unexpected end of file found

能不能解答一下怎么改程序,或者这个程序应该怎么看啊


missing storage-class or type specifiers的原因及解决办法_0店小二的博客-CSDN博客 error C2143: syntax error : missing ';' before '*'error C2501: 'CTest1Doc' : missing storage-class or type specifierserror C2501: 'GetDocument' : missing storage-class or type specifiers遇到这种莫名的错 https://blog.csdn.net/ljb825802164/article/details/51115965

fatal error C1004unexpected end of file found_科KO的博客-CSDN博客 关于VC++6.0常常出现的错误提醒fatal error C1004unexpected end of file found https://blog.csdn.net/qq_35614554/article/details/51919402

三篇文章,一一对应错误点

求采纳

编译器提示uint16这个类型名称不认识,缺少相应的头文件包含
然后函数少了最后的大括号