Skip to content

Commit

Permalink
Fixed wordrep not working when compiled with Visual Studio.
Browse files Browse the repository at this point in the history
  • Loading branch information
davisking committed May 18, 2018
1 parent 3418994 commit 15bed49
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 27 deletions.
37 changes: 20 additions & 17 deletions dlib/dlib/matrix/matrix_data_layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,21 +429,24 @@ namespace dlib
}

T& operator() (
long r,
long c
) { return data[r*nc_ + c]; }
size_t r,
size_t c
)
{
return data[r*nc_ + c];
}

const T& operator() (
long r,
long c
size_t r,
size_t c
) const { return data[r*nc_ + c]; }

T& operator() (
long i
size_t i
) { return data[i]; }

const T& operator() (
long i
size_t i
) const { return data[i]; }

void swap(
Expand All @@ -463,8 +466,8 @@ namespace dlib
) const { return nc_; }

void set_size (
long nr,
long nc
size_t nr,
size_t nc
)
{
if (data)
Expand Down Expand Up @@ -842,21 +845,21 @@ namespace dlib
}

T& operator() (
long r,
long c
size_t r,
size_t c
) { return data[c*nr_ + r]; }

const T& operator() (
long r,
long c
size_t r,
size_t c
) const { return data[c*nr_ + r]; }

T& operator() (
long i
size_t i
) { return data[i]; }

const T& operator() (
long i
size_t i
) const { return data[i]; }

void swap(
Expand All @@ -876,8 +879,8 @@ namespace dlib
) const { return nc_; }

void set_size (
long nr,
long nc
size_t nr,
size_t nc
)
{
if (data)
Expand Down
18 changes: 9 additions & 9 deletions dlib/dlib/memory_manager/memory_manager_kernel_1.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace dlib

template <
typename T,
unsigned long max_pool_size
size_t max_pool_size
>
class memory_manager_kernel_1
{
Expand Down Expand Up @@ -86,11 +86,11 @@ namespace dlib
}
}

unsigned long get_number_of_allocations (
size_t get_number_of_allocations (
) const { return allocations; }

T* allocate_array (
unsigned long size
size_t size
)
{
T* temp = new T[size];
Expand Down Expand Up @@ -183,9 +183,9 @@ namespace dlib
private:

// data members
unsigned long allocations;
size_t allocations;
node* next;
unsigned long pool_size;
size_t pool_size;

// restricted functions
memory_manager_kernel_1(memory_manager_kernel_1&); // copy constructor
Expand Down Expand Up @@ -231,11 +231,11 @@ namespace dlib
{
}

unsigned long get_number_of_allocations (
size_t get_number_of_allocations (
) const { return allocations; }

T* allocate_array (
unsigned long size
size_t size
)
{
T* temp = new T[size];
Expand Down Expand Up @@ -277,7 +277,7 @@ namespace dlib
private:

// data members
unsigned long allocations;
size_t allocations;

// restricted functions
memory_manager_kernel_1(memory_manager_kernel_1&); // copy constructor
Expand All @@ -288,7 +288,7 @@ namespace dlib

template <
typename T,
unsigned long max_pool_size
size_t max_pool_size
>
inline void swap (
memory_manager_kernel_1<T,max_pool_size>& a,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace dlib
}

T* allocate_array (
unsigned long size
size_t size
)
{
return new T[size];
Expand Down

0 comments on commit 15bed49

Please sign in to comment.