Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: ced1401: Patch removes typedef unsigned int DWORD.

Patch removes usage of typedef unsigned int DWORD.

Signed-off-by: Elena Ufimtseva <ufimtseva@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Elena Ufimtseva and committed by
Greg Kroah-Hartman
8c79caa8 4e0825fd

+75 -76
-1
drivers/staging/ced1401/machine.h
··· 82 82 typedef int BOOL; /* To match Windows */ 83 83 typedef char *LPSTR; 84 84 typedef const char *LPCSTR; 85 - typedef unsigned int DWORD; 86 85 typedef unsigned char BYTE; 87 86 typedef BYTE BOOLEAN; 88 87 typedef unsigned char UCHAR;
+15 -15
drivers/staging/ced1401/use1401.h
··· 222 222 U14API(short) U14GetChar(short hand, char *pcChar); 223 223 224 224 U14API(short) U14LdCmd(short hand, const char *command); 225 - U14API(DWORD) U14Ld(short hand, const char *vl, const char *str); 225 + U14API(unsigned int) U14Ld(short hand, const char *vl, const char *str); 226 226 227 227 U14API(short) U14SetTransArea(short hand, unsigned short wArea, void *pvBuff, 228 - DWORD dwLength, short eSz); 228 + unsigned int dwLength, short eSz); 229 229 U14API(short) U14UnSetTransfer(short hand, unsigned short wArea); 230 230 U14API(short) U14SetTransferEvent(short hand, unsigned short wArea, BOOL bEvent, 231 - BOOL bToHost, DWORD dwStart, DWORD dwLength); 231 + BOOL bToHost, unsigned int dwStart, unsigned int dwLength); 232 232 U14API(int) U14TestTransferEvent(short hand, unsigned short wArea); 233 233 U14API(int) U14WaitTransferEvent(short hand, unsigned short wArea, int msTimeOut); 234 234 U14API(short) U14GetTransfer(short hand, TGET_TX_BLOCK *pTransBlock); 235 235 236 - U14API(short) U14ToHost(short hand, char *pAddrHost, DWORD dwSize, DWORD dw1401, 236 + U14API(short) U14ToHost(short hand, char *pAddrHost, unsigned int dwSize, unsigned int dw1401, 237 237 short eSz); 238 - U14API(short) U14To1401(short hand, const char *pAddrHost, DWORD dwSize, DWORD dw1401, 238 + U14API(short) U14To1401(short hand, const char *pAddrHost, unsigned int dwSize, unsigned int dw1401, 239 239 short eSz); 240 240 241 241 U14API(short) U14SetCircular(short hand, unsigned short wArea, BOOL bToHost, void *pvBuff, 242 - DWORD dwLength); 242 + unsigned int dwLength); 243 243 244 - U14API(int) U14GetCircBlk(short hand, unsigned short wArea, DWORD *pdwOffs); 245 - U14API(int) U14FreeCircBlk(short hand, unsigned short wArea, DWORD dwOffs, DWORD dwSize, 246 - DWORD *pdwOffs); 244 + U14API(int) U14GetCircBlk(short hand, unsigned short wArea, unsigned int *pdwOffs); 245 + U14API(int) U14FreeCircBlk(short hand, unsigned short wArea, unsigned int dwOffs, unsigned int dwSize, 246 + unsigned int *pdwOffs); 247 247 248 248 U14API(short) U14StrToLongs(const char *pszBuff, U14LONG *palNums, short sMaxLongs); 249 249 U14API(short) U14LongsFrom1401(short hand, U14LONG *palBuff, short sMaxLongs); ··· 255 255 U14API(int) U14DriverVersion(short hand); 256 256 U14API(int) U14DriverType(short hand); 257 257 U14API(short) U14DriverName(short hand, char *pBuf, unsigned short wMax); 258 - U14API(short) U14GetUserMemorySize(short hand, DWORD *pMemorySize); 258 + U14API(short) U14GetUserMemorySize(short hand, unsigned int *pMemorySize); 259 259 U14API(short) U14KillIO1401(short hand); 260 260 261 261 U14API(short) U14BlkTransState(short hand); ··· 263 263 264 264 U14API(short) U14Grab1401(short hand); 265 265 U14API(short) U14Free1401(short hand); 266 - U14API(short) U14Peek1401(short hand, DWORD dwAddr, int nSize, int nRepeats); 267 - U14API(short) U14Poke1401(short hand, DWORD dwAddr, DWORD dwValue, int nSize, int nRepeats); 268 - U14API(short) U14Ramp1401(short hand, DWORD dwAddr, DWORD dwDef, DWORD dwEnable, int nSize, int nRepeats); 269 - U14API(short) U14RampAddr(short hand, DWORD dwDef, DWORD dwEnable, int nSize, int nRepeats); 266 + U14API(short) U14Peek1401(short hand, unsigned int dwAddr, int nSize, int nRepeats); 267 + U14API(short) U14Poke1401(short hand, unsigned int dwAddr, unsigned int dwValue, int nSize, int nRepeats); 268 + U14API(short) U14Ramp1401(short hand, unsigned int dwAddr, unsigned int dwDef, unsigned int dwEnable, int nSize, int nRepeats); 269 + U14API(short) U14RampAddr(short hand, unsigned int dwDef, unsigned int dwEnable, int nSize, int nRepeats); 270 270 U14API(short) U14StopDebugLoop(short hand); 271 271 U14API(short) U14GetDebugData(short hand, U14LONG *plValue); 272 272 ··· 277 277 U14API(int) U14MonitorRev(short hand); 278 278 U14API(void) U14CloseAll(void); 279 279 280 - U14API(short) U14WorkingSet(DWORD dwMinKb, DWORD dwMaxKb); 280 + U14API(short) U14WorkingSet(unsigned int dwMinKb, unsigned int dwMaxKb); 281 281 U14API(int) U14InitLib(void); 282 282 283 283 #ifdef __cplusplus
+3 -3
drivers/staging/ced1401/use14_ioc.h
··· 280 280 { 281 281 unsigned short wArea; /* number of transfer area to set up */ 282 282 void FAR *lpvBuff; /* address of transfer area */ 283 - DWORD dwLength; /* length of area to set up */ 283 + unsigned int dwLength; /* length of area to set up */ 284 284 short eSize; /* size to move (for swapping on MAC) */ 285 285 } TRANSFERDESC; 286 286 ··· 291 291 { 292 292 unsigned short wArea; /* number of transfer area to set up */ 293 293 unsigned short wAddrSel; /* 16 bit selector for area */ 294 - DWORD dwAddrOfs; /* 32 bit offset for area start */ 295 - DWORD dwLength; /* length of area to set up */ 294 + unsigned int dwAddrOfs; /* 32 bit offset for area start */ 295 + unsigned int dwLength; /* length of area to set up */ 296 296 } VXTRANSFERDESC; 297 297 298 298 #pragma pack()
+57 -57
drivers/staging/ced1401/userspace/use1401.c
··· 36 36 ** Under Windows 9x and NT, Use1401 uses DeviceIoControl to get access to 37 37 ** the 1401 driver. This has parameters for the device handle, the function 38 38 ** code, an input pointer and byte count, an output pointer and byte count 39 - ** and a pointer to a DWORD to hold the output byte count. Note that input 39 + ** and a pointer to a unsigned int to hold the output byte count. Note that input 40 40 ** and output are from the point-of-view of the driver, so the output stuff 41 41 ** is used to read values from the 1401, not send to the 1401. The use of 42 42 ** these parameters varies with the function in use and the operating ··· 250 250 static HANDLE aHand1401[MAX1401] = {0}; // handles for 1401s 251 251 static HANDLE aXferEvent[MAX1401] = {0}; // transfer events for the 1401s 252 252 static LPVOID apAreas[MAX1401][MAX_TRANSAREAS]; // Locked areas 253 - static DWORD auAreas[MAX1401][MAX_TRANSAREAS]; // Size of locked areas 253 + static unsigned int auAreas[MAX1401][MAX_TRANSAREAS]; // Size of locked areas 254 254 static BOOL bWindows9x = FALSE; // if we are Windows 95 or better 255 255 #ifdef _WIN64 256 256 #define USE_NT_DIOC(ind) TRUE ··· 311 311 ****************************************************************************/ 312 312 static short U14Status1401(short sHand, LONG lCode, TCSBLOCK* pBlk) 313 313 { 314 - DWORD dwBytes = 0; 314 + unsigned int dwBytes = 0; 315 315 316 316 if ((sHand < 0) || (sHand >= MAX1401)) /* Check parameters */ 317 317 return U14ERR_BADHAND; ··· 345 345 ****************************************************************************/ 346 346 static short U14Control1401(short sHand, LONG lCode, TCSBLOCK* pBlk) 347 347 { 348 - DWORD dwBytes = 0; 348 + unsigned int dwBytes = 0; 349 349 350 350 if ((sHand < 0) || (sHand >= MAX1401)) /* Check parameters */ 351 351 return U14ERR_BADHAND; ··· 779 779 ** is called. After the peek is done, use U14GetDebugData to retrieve 780 780 ** the results of the peek. 781 781 ****************************************************************************/ 782 - U14API(short) U14Peek1401(short hand, DWORD dwAddr, int nSize, int nRepeats) 782 + U14API(short) U14Peek1401(short hand, unsigned int dwAddr, int nSize, int nRepeats) 783 783 { 784 784 short sErr = CheckHandle(hand); 785 785 if (sErr == U14ERR_NOERROR) ··· 813 813 ** If lRepeats is zero, the loop will continue until U14StopDebugLoop 814 814 ** is called. 815 815 ****************************************************************************/ 816 - U14API(short) U14Poke1401(short hand, DWORD dwAddr, DWORD dwValue, 816 + U14API(short) U14Poke1401(short hand, unsigned int dwAddr, unsigned int dwValue, 817 817 int nSize, int nRepeats) 818 818 { 819 819 short sErr = CheckHandle(hand); ··· 849 849 ** DESCRIPTION Cause the 1401 to loop, writing a ramp to a location. 850 850 ** If lRepeats is zero, the loop will continue until U14StopDebugLoop. 851 851 ****************************************************************************/ 852 - U14API(short) U14Ramp1401(short hand, DWORD dwAddr, DWORD dwDef, DWORD dwEnable, 852 + U14API(short) U14Ramp1401(short hand, unsigned int dwAddr, unsigned int dwDef, unsigned int dwEnable, 853 853 int nSize, int nRepeats) 854 854 { 855 855 short sErr = CheckHandle(hand); ··· 887 887 ** DESCRIPTION Cause the 1401 to loop, reading from a ramping location. 888 888 ** If lRepeats is zero, the loop will continue until U14StopDebugLoop 889 889 ****************************************************************************/ 890 - U14API(short) U14RampAddr(short hand, DWORD dwDef, DWORD dwEnable, 890 + U14API(short) U14RampAddr(short hand, unsigned int dwDef, unsigned int dwEnable, 891 891 int nSize, int nRepeats) 892 892 { 893 893 short sErr = CheckHandle(hand); ··· 1024 1024 /**************************************************************************** 1025 1025 ** U14GetUserMemorySize 1026 1026 ****************************************************************************/ 1027 - U14API(short) U14GetUserMemorySize(short hand, DWORD *pMemorySize) 1027 + U14API(short) U14GetUserMemorySize(short hand, unsigned int *pMemorySize) 1028 1028 { 1029 1029 // The original 1401 used a different command for getting the size 1030 1030 short sErr = U14SendString(hand, (asType1401[hand] == U14TYPE1401) ? "MEMTOP;" : "MEMTOP,?;"); ··· 1207 1207 { 1208 1208 short sErr = U14ERR_NOERROR; 1209 1209 HANDLE hDevice = INVALID_HANDLE_VALUE; 1210 - DWORD dwErr = 0; 1210 + unsigned int dwErr = 0; 1211 1211 int nFirst, nLast, nDev = 0; /* Used for the search for a 1401 */ 1212 1212 BOOL bOldName = FALSE; /* start by looking for a modern driver */ 1213 1213 ··· 1262 1262 } 1263 1263 else 1264 1264 { 1265 - DWORD dwe = GetLastError(); /* Get error code otherwise */ 1265 + unsigned int dwe = GetLastError(); /* Get error code otherwise */ 1266 1266 if ((dwe != ERROR_FILE_NOT_FOUND) || (dwErr == 0)) 1267 1267 dwErr = dwe; /* Ignore repeats of 'not found' */ 1268 1268 } ··· 1581 1581 if (bSpaceToSend) 1582 1582 { 1583 1583 PARAMBLK rData; 1584 - DWORD dwBytes; 1584 + unsigned int dwBytes; 1585 1585 char tstr[MAXSTRLEN+5]; /* Buffer for chars */ 1586 1586 1587 1587 if ((hand < 0) || (hand >= MAX1401)) ··· 1592 1592 #ifndef _WIN64 1593 1593 if (!USE_NT_DIOC(hand)) /* Using WIN 95 driver access? */ 1594 1594 { 1595 - int iOK = DeviceIoControl(aHand1401[hand], (DWORD)U14_SENDSTRING, 1595 + int iOK = DeviceIoControl(aHand1401[hand], (unsigned int)U14_SENDSTRING, 1596 1596 NULL, 0, tstr, nChars, 1597 1597 &dwBytes, NULL); 1598 1598 if (iOK) 1599 - sErr = (dwBytes >= (DWORD)nChars) ? U14ERR_NOERROR : U14ERR_DRIVCOMMS; 1599 + sErr = (dwBytes >= (unsigned int)nChars) ? U14ERR_NOERROR : U14ERR_DRIVCOMMS; 1600 1600 else 1601 1601 sErr = (short)GetLastError(); 1602 1602 } 1603 1603 else 1604 1604 #endif 1605 1605 { 1606 - int iOK = DeviceIoControl(aHand1401[hand],(DWORD)U14_SENDSTRING, 1606 + int iOK = DeviceIoControl(aHand1401[hand],(unsigned int)U14_SENDSTRING, 1607 1607 tstr, nChars, 1608 1608 &rData,sizeof(PARAMBLK),&dwBytes,NULL); 1609 1609 if (iOK && (dwBytes >= sizeof(PARAMBLK))) ··· 1726 1726 { 1727 1727 if (asLastRetCode[hand] == U14ERR_NOERROR) /* all ok so far */ 1728 1728 { 1729 - DWORD dwBytes = 0; 1729 + unsigned int dwBytes = 0; 1730 1730 *((unsigned short *)pBuffer) = wMaxLen; /* set up length */ 1731 1731 #ifndef _WIN64 1732 1732 if (!USE_NT_DIOC(hand)) /* Win 95 DIOC here ? */ ··· 1739 1739 1740 1740 *((unsigned short *)tstr) = wMaxLen; /* set len */ 1741 1741 1742 - iOK = DeviceIoControl(aHand1401[hand],(DWORD)U14_GETSTRING, 1742 + iOK = DeviceIoControl(aHand1401[hand],(unsigned int)U14_GETSTRING, 1743 1743 NULL, 0, tstr, wMaxLen+sizeof(short), 1744 1744 &dwBytes, NULL); 1745 1745 if (iOK) /* Device IO control OK ? */ ··· 1768 1768 char* pMem = (char*)GlobalLock(hMem); 1769 1769 if (pMem) 1770 1770 { 1771 - int iOK = DeviceIoControl(aHand1401[hand],(DWORD)U14_GETSTRING, 1771 + int iOK = DeviceIoControl(aHand1401[hand],(unsigned int)U14_GETSTRING, 1772 1772 NULL, 0, pMem, wMaxLen+sizeof(short), 1773 1773 &dwBytes, NULL); 1774 1774 if (iOK) /* Device IO control OK ? */ ··· 2120 2120 #ifdef _IS_WINDOWS_ 2121 2121 if (sErr == U14ERR_NOERROR) 2122 2122 { 2123 - DWORD dwBytes = 0; 2124 - BOOL bOK = DeviceIoControl(aHand1401[hand], (DWORD)U14_GETTRANSFER, NULL, 0, pTransBlock, 2123 + unsigned int dwBytes = 0; 2124 + BOOL bOK = DeviceIoControl(aHand1401[hand], (unsigned int)U14_GETTRANSFER, NULL, 0, pTransBlock, 2125 2125 sizeof(TGET_TX_BLOCK), &dwBytes, NULL); 2126 2126 2127 2127 if (bOK && (dwBytes >= sizeof(TGET_TX_BLOCK))) ··· 2145 2145 // 1 unable to access process (insufficient rights?) 2146 2146 // 2 unable to read process working set 2147 2147 // 3 unable to set process working set - bad parameters? 2148 - U14API(short) U14WorkingSet(DWORD dwMinKb, DWORD dwMaxKb) 2148 + U14API(short) U14WorkingSet(unsigned int dwMinKb, unsigned int dwMaxKb) 2149 2149 { 2150 2150 #ifdef _IS_WINDOWS_ 2151 2151 short sRetVal = 0; // 0 means all is OK 2152 2152 HANDLE hProcess; 2153 - DWORD dwVer = GetVersion(); 2153 + unsigned int dwVer = GetVersion(); 2154 2154 if (dwVer & 0x80000000) // is this not NT? 2155 2155 return 0; // then give up right now 2156 2156 ··· 2164 2164 SIZE_T dwMinSize,dwMaxSize; 2165 2165 if (GetProcessWorkingSetSize(hProcess, &dwMinSize, &dwMaxSize)) 2166 2166 { 2167 - DWORD dwMin = dwMinKb << 10; // convert from kb to bytes 2168 - DWORD dwMax = dwMaxKb << 10; 2167 + unsigned int dwMin = dwMinKb << 10; // convert from kb to bytes 2168 + unsigned int dwMax = dwMaxKb << 10; 2169 2169 2170 2170 // if we get here, we have managed to read the current size 2171 2171 if (dwMin > dwMinSize) // need to change sizes? ··· 2225 2225 ** U14SetTransArea Sets an area up to be used for transfers 2226 2226 ** unsigned short wArea The area number to set up 2227 2227 ** void *pvBuff The address of the buffer for the data. 2228 - ** DWORD dwLength The length of the buffer for the data 2228 + ** unsigned int dwLength The length of the buffer for the data 2229 2229 ** short eSz The element size (used for byte swapping on the Mac) 2230 2230 ****************************************************************************/ 2231 2231 U14API(short) U14SetTransArea(short hand, unsigned short wArea, void *pvBuff, 2232 - DWORD dwLength, short eSz) 2232 + unsigned int dwLength, short eSz) 2233 2233 { 2234 2234 TRANSFERDESC td; 2235 2235 short sErr = CheckHandle(hand); ··· 2254 2254 #ifndef _WIN64 2255 2255 if (!USE_NT_DIOC(hand)) /* Use Win 9x DIOC? */ 2256 2256 { 2257 - DWORD dwBytes; 2257 + unsigned int dwBytes; 2258 2258 VXTRANSFERDESC vxDesc; /* Structure to pass to VXD */ 2259 2259 vxDesc.wArea = wArea; /* Copy across simple params */ 2260 2260 vxDesc.dwLength = dwLength; ··· 2264 2264 sErr = U14ERR_DRIVTOOOLD; 2265 2265 else 2266 2266 { 2267 - vxDesc.dwAddrOfs = (DWORD)pvBuff; /* 32 bit offset */ 2267 + vxDesc.dwAddrOfs = (unsigned int)pvBuff; /* 32 bit offset */ 2268 2268 vxDesc.wAddrSel = 0; 2269 2269 2270 - if (DeviceIoControl(aHand1401[hand], (DWORD)U14_SETTRANSFER, 2270 + if (DeviceIoControl(aHand1401[hand], (unsigned int)U14_SETTRANSFER, 2271 2271 pvBuff,dwLength, /* Will translate pointer */ 2272 2272 &vxDesc,sizeof(VXTRANSFERDESC), 2273 2273 &dwBytes,NULL)) ··· 2285 2285 #endif 2286 2286 { 2287 2287 PARAMBLK rWork; 2288 - DWORD dwBytes; 2288 + unsigned int dwBytes; 2289 2289 td.wArea = wArea; /* Pure NT - put data into struct */ 2290 2290 td.lpvBuff = pvBuff; 2291 2291 td.dwLength = dwLength; 2292 2292 td.eSize = 0; // Dummy element size 2293 2293 2294 - if (DeviceIoControl(aHand1401[hand],(DWORD)U14_SETTRANSFER, 2294 + if (DeviceIoControl(aHand1401[hand],(unsigned int)U14_SETTRANSFER, 2295 2295 &td,sizeof(TRANSFERDESC), 2296 2296 &rWork,sizeof(PARAMBLK),&dwBytes,NULL)) 2297 2297 { ··· 2345 2345 ** a negative code for an error. 2346 2346 ****************************************************************************/ 2347 2347 U14API(short) U14SetTransferEvent(short hand, unsigned short wArea, BOOL bEvent, 2348 - BOOL bToHost, DWORD dwStart, DWORD dwLength) 2348 + BOOL bToHost, unsigned int dwStart, unsigned int dwLength) 2349 2349 { 2350 2350 #ifdef _IS_WINDOWS_ 2351 2351 TCSBLOCK csBlock; ··· 2469 2469 ** unsigned short wArea The area number to set up 2470 2470 ** BOOL bToHost Sets the direction of data transfer 2471 2471 ** void *pvBuff The address of the buffer for the data 2472 - ** DWORD dwLength The length of the buffer for the data 2472 + ** unsigned int dwLength The length of the buffer for the data 2473 2473 ****************************************************************************/ 2474 2474 U14API(short) U14SetCircular(short hand, unsigned short wArea, BOOL bToHost, 2475 - void *pvBuff, DWORD dwLength) 2475 + void *pvBuff, unsigned int dwLength) 2476 2476 { 2477 2477 short sErr = CheckHandle(hand); 2478 2478 if (sErr != U14ERR_NOERROR) ··· 2495 2495 else 2496 2496 { 2497 2497 PARAMBLK rWork; 2498 - DWORD dwBytes; 2498 + unsigned int dwBytes; 2499 2499 TRANSFERDESC txDesc; 2500 2500 txDesc.wArea = wArea; /* Pure NT - put data into struct */ 2501 2501 txDesc.lpvBuff = pvBuff; 2502 2502 txDesc.dwLength = dwLength; 2503 2503 txDesc.eSize = (short)bToHost; /* Use this for direction flag */ 2504 2504 2505 - if (DeviceIoControl(aHand1401[hand],(DWORD)U14_SETCIRCULAR, 2505 + if (DeviceIoControl(aHand1401[hand],(unsigned int)U14_SETCIRCULAR, 2506 2506 &txDesc, sizeof(TRANSFERDESC), 2507 2507 &rWork, sizeof(PARAMBLK),&dwBytes,NULL)) 2508 2508 { ··· 2542 2542 ** Function GetCircBlk returns the size (& start offset) of the next 2543 2543 ** available block of circular data. 2544 2544 ****************************************************************************/ 2545 - U14API(int) U14GetCircBlk(short hand, unsigned short wArea, DWORD *pdwOffs) 2545 + U14API(int) U14GetCircBlk(short hand, unsigned short wArea, unsigned int *pdwOffs) 2546 2546 { 2547 2547 int lErr = CheckHandle(hand); 2548 2548 if (lErr != U14ERR_NOERROR) ··· 2555 2555 #ifdef _IS_WINDOWS_ 2556 2556 PARAMBLK rWork; 2557 2557 TCSBLOCK csBlock; 2558 - DWORD dwBytes; 2558 + unsigned int dwBytes; 2559 2559 csBlock.longs[0] = wArea; // Area number into control block 2560 2560 rWork.sState = U14ERR_DRIVCOMMS; 2561 - if (DeviceIoControl(aHand1401[hand], (DWORD)U14_GETCIRCBLK, &csBlock, sizeof(TCSBLOCK), &rWork, sizeof(PARAMBLK), &dwBytes, NULL) && 2561 + if (DeviceIoControl(aHand1401[hand], (unsigned int)U14_GETCIRCBLK, &csBlock, sizeof(TCSBLOCK), &rWork, sizeof(PARAMBLK), &dwBytes, NULL) && 2562 2562 (dwBytes >= sizeof(PARAMBLK))) 2563 2563 lErr = rWork.sState; 2564 2564 else ··· 2591 2591 ** resuse for circular transfers and returns the size (& start 2592 2592 ** offset) of the next available block of circular data. 2593 2593 ****************************************************************************/ 2594 - U14API(int) U14FreeCircBlk(short hand, unsigned short wArea, DWORD dwOffs, DWORD dwSize, 2595 - DWORD *pdwOffs) 2594 + U14API(int) U14FreeCircBlk(short hand, unsigned short wArea, unsigned int dwOffs, unsigned int dwSize, 2595 + unsigned int *pdwOffs) 2596 2596 { 2597 2597 int lErr = CheckHandle(hand); 2598 2598 if (lErr != U14ERR_NOERROR) ··· 2603 2603 #ifdef _IS_WINDOWS_ 2604 2604 PARAMBLK rWork; 2605 2605 TCSBLOCK csBlock; 2606 - DWORD dwBytes; 2606 + unsigned int dwBytes; 2607 2607 csBlock.longs[0] = wArea; // Area number into control block 2608 2608 csBlock.longs[1] = dwOffs; 2609 2609 csBlock.longs[2] = dwSize; 2610 2610 rWork.sState = U14ERR_DRIVCOMMS; 2611 - if (DeviceIoControl(aHand1401[hand], (DWORD)U14_FREECIRCBLK, &csBlock, sizeof(TCSBLOCK), 2611 + if (DeviceIoControl(aHand1401[hand], (unsigned int)U14_FREECIRCBLK, &csBlock, sizeof(TCSBLOCK), 2612 2612 &rWork, sizeof(PARAMBLK), &dwBytes, NULL) && 2613 2613 (dwBytes >= sizeof(PARAMBLK))) 2614 2614 lErr = rWork.sState; ··· 2647 2647 ** which it should be to get a pointer 2648 2648 *****************************************************************************/ 2649 2649 static short Transfer(short hand, BOOL bTo1401, char* pData, 2650 - DWORD dwSize, DWORD dw1401, short eSz) 2650 + unsigned int dwSize, unsigned int dw1401, short eSz) 2651 2651 { 2652 2652 char strcopy[MAXSTRLEN+1]; // to hold copy of work string 2653 2653 short sResult = U14SetTransArea(hand, 0, (void *)pData, dwSize, eSz); ··· 2670 2670 /**************************************************************************** 2671 2671 ** Function ToHost transfers data into the host from the 1401 2672 2672 ****************************************************************************/ 2673 - U14API(short) U14ToHost(short hand, char* pAddrHost, DWORD dwSize, 2674 - DWORD dw1401, short eSz) 2673 + U14API(short) U14ToHost(short hand, char* pAddrHost, unsigned int dwSize, 2674 + unsigned int dw1401, short eSz) 2675 2675 { 2676 2676 short sErr = CheckHandle(hand); 2677 2677 if ((sErr == U14ERR_NOERROR) && dwSize) // TOHOST is a constant ··· 2682 2682 /**************************************************************************** 2683 2683 ** Function To1401 transfers data into the 1401 from the host 2684 2684 ****************************************************************************/ 2685 - U14API(short) U14To1401(short hand, const char* pAddrHost,DWORD dwSize, 2686 - DWORD dw1401, short eSz) 2685 + U14API(short) U14To1401(short hand, const char* pAddrHost,unsigned int dwSize, 2686 + unsigned int dw1401, short eSz) 2687 2687 { 2688 2688 short sErr = CheckHandle(hand); 2689 2689 if ((sErr == U14ERR_NOERROR) && dwSize) // TO1401 is a constant ··· 2707 2707 #define file_close(h) close(h) 2708 2708 #define file_seek(h, pos) lseek(h, pos, SEEK_SET) 2709 2709 #define file_read(h, buffer, size) (read(h, buffer, size) == (ssize_t)size) 2710 - static DWORD GetModuleFileName(void* dummy, char* buffer, int max) 2710 + static unsigned int GetModuleFileName(void* dummy, char* buffer, int max) 2711 2711 { 2712 2712 // The following works for Linux systems with a /proc file system. 2713 2713 char szProcPath[32]; ··· 2766 2766 // application was run from. 2767 2767 if (!bGotIt) // Still not got it? 2768 2768 { 2769 - DWORD dwLen = GetModuleFileName(NULL, filnam, FNSZ); // Get app path 2769 + unsigned int dwLen = GetModuleFileName(NULL, filnam, FNSZ); // Get app path 2770 2770 if (dwLen > 0) // and use it as path if found 2771 2771 { 2772 2772 char* pStr = strrchr(filnam, PATHSEP); // Point to last separator ··· 2821 2821 file_seek(iFHandle, sizeof(CMDHEAD)); 2822 2822 if (file_read(iFHandle, pMem, (UINT)nComSize)) 2823 2823 { 2824 - sErr = U14SetTransArea(hand, 0, (void *)pMem, (DWORD)nComSize, ESZBYTES); 2824 + sErr = U14SetTransArea(hand, 0, (void *)pMem, (unsigned int)nComSize, ESZBYTES); 2825 2825 if (sErr == U14ERR_NOERROR) 2826 2826 { 2827 2827 sprintf(strcopy, "CLOAD,0,$%X;", (int)nComSize); ··· 2858 2858 ** Returns NOERROR code or a long with error in lo word and index of 2859 2859 ** command that failed in high word 2860 2860 ****************************************************************************/ 2861 - U14API(DWORD) U14Ld(short hand, const char* vl, const char* str) 2861 + U14API(unsigned int) U14Ld(short hand, const char* vl, const char* str) 2862 2862 { 2863 - DWORD dwIndex = 0; // index to current command 2863 + unsigned int dwIndex = 0; // index to current command 2864 2864 long lErr = U14ERR_NOERROR; // what the error was that went wrong 2865 2865 char strcopy[MAXSTRLEN+1]; // stores unmodified str parameter 2866 2866 char szFExt[8]; // The command file extension ··· 2939 2939 return lErr; 2940 2940 } 2941 2941 else 2942 - return ((dwIndex<<16) | ((DWORD)lErr & 0x0000FFFF)); 2942 + return ((dwIndex<<16) | ((unsigned int)lErr & 0x0000FFFF)); 2943 2943 } 2944 2944 2945 2945 // Initialise the library (if not initialised) and return the library version ··· 2951 2951 int i; 2952 2952 #ifdef _IS_WINDOWS_ 2953 2953 int j; 2954 - DWORD dwVersion = GetVersion(); 2954 + unsigned int dwVersion = GetVersion(); 2955 2955 bWindows9x = FALSE; // Assume not Win9x 2956 2956 2957 2957 if (dwVersion & 0x80000000) // if not windows NT ··· 2993 2993 #ifdef _IS_WINDOWS_ 2994 2994 #ifndef U14_NOT_DLL 2995 2995 /**************************************************************************** 2996 - ** FUNCTION: DllMain(HANDLE, DWORD, LPVOID) 2996 + ** FUNCTION: DllMain(HANDLE, unsigned int, LPVOID) 2997 2997 ** LibMain is called by Windows when the DLL is initialized, Thread Attached, 2998 2998 ** and other times. Refer to SDK documentation, as to the different ways this 2999 2999 ** may be called. 3000 3000 ****************************************************************************/ 3001 - INT APIENTRY DllMain(HANDLE hInst, DWORD ul_reason_being_called, LPVOID lpReserved) 3001 + INT APIENTRY DllMain(HANDLE hInst, unsigned int ul_reason_being_called, LPVOID lpReserved) 3002 3002 { 3003 3003 int iRetVal = 1; 3004 3004