Skip to content

Commit

Permalink
C++ cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukacu committed Oct 27, 2016
1 parent dfad734 commit 9b6e530
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions lib/trax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ Wrapper::~Wrapper() {

}

void Wrapper::swap(Wrapper& lhs) throw() {
void Wrapper::swap(Wrapper& lhs) {
std::swap(pn, lhs.pn);
}

long Wrapper::claims() throw() {
long Wrapper::claims() const {
long count = 0;
if (NULL != pn)
{
Expand All @@ -103,7 +103,7 @@ void Wrapper::acquire() {
++(*pn);
}

void Wrapper::release() throw() {
void Wrapper::release() {
if (NULL != pn) {
--(*pn);
if (0 == *pn) {
Expand Down Expand Up @@ -379,6 +379,7 @@ void Region::set(float x, float y, float width, float height) {
}

void Region::get(float* x, float* y, float* width, float* height) const {
if (empty()) return;

trax_region_get_rectangle(region, x, y, width, height);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/trax.h
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,9 @@ class __TRAX_EXPORT Wrapper {

Wrapper(const Wrapper& count);

void swap(Wrapper& lhs) throw();
void swap(Wrapper& lhs);

long claims() throw();
long claims() const;

/**
* Call after the wrapped pointer has been created or copied to increase
Expand All @@ -509,7 +509,7 @@ class __TRAX_EXPORT Wrapper {
* Call instead of releasing memory to decrease reference count. If the
* reference count comes to zero then cleanup() is called.
**/
void release() throw();
void release();

virtual void cleanup() = 0;

Expand Down

0 comments on commit 9b6e530

Please sign in to comment.