123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- $OpenBSD: patch-cmn_utils_cpp,v 1.4 2017/05/02 23:26:32 espie Exp $
- Index: cmn/utils.cpp
- --- cmn/utils.cpp.orig
- +++ cmn/utils.cpp
- @@ -30,18 +30,21 @@
-
- // Include Files
- #include "stdafx.h"
- -#include <iostream.h>
- -#include <limits.h>
- -#include <string.h>
- -#include <ctype.h>
- -#include <fstream.h>
- +#include <iostream>
- +
- +#include <climits>
- +#include <cstring>
- +#include <cctype>
- +#include <fstream>
- #if WIN32
- #include <strstrea.h>
- #endif
- #if X11
- -#include <strstream.h>
- +#include <strstream>
- #endif
-
- +using namespace std;
- +
- #ifdef WIN32
- // For file manipulation routines.
- #include <direct.h>
- @@ -605,7 +608,7 @@ void PtrList::write(OutStreamP out) const{
- // Not tested.
- out->write_int(len);
- for (int n = 0; n < len; n++) {
- - out->write_int((int)data[n]);
- + out->write_int((intptr_t)data[n]);
- }
- }
-
- @@ -761,7 +764,7 @@ class HashTable: public IDictionary {
(public)
-
-
- private:
- - Bucket* HashTable::_get(int &index,void* key);
- + Bucket* _get(int &index,void* key);
- /* MODIFIES: index */
- /* EFFECTS: Internal helper function. Return the Bucket containing key
- or NULL if not found. Set index to the bucket list for key whether
- @@ -944,7 +947,7 @@ Bucket* HashTable::_get(int &index,void* key) {
- // Pretty crappy hash function, I know.
- // Careful if bucketsNum is a power of 2.
- int HashTable::defaultHash(void* key,int bucketsNum) {
- - return ((unsigned int)key) % bucketsNum;
- + return ((uintptr_t)key) % bucketsNum;
- }
-
-
|