Skip to content

Commit

Permalink
Strip trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
externl committed May 3, 2017
1 parent a2ef89b commit 71260a4
Show file tree
Hide file tree
Showing 110 changed files with 615 additions and 615 deletions.
6 changes: 3 additions & 3 deletions cpp/BuildInstructionsOSX.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ You can install Berkeley DB with [Homebrew][3] as follows:

### Step 1: build IceXML and testcommon in the ice submodule

Edit `freeze/ice/config/Make.rules` to establish your build configuration.
Edit `freeze/ice/config/Make.rules` to establish your build configuration.
The comments in the file provide more information.

cd freeze/ice/cpp
Expand All @@ -39,7 +39,7 @@ The comments in the file provide more information.
cd freeze/cpp
make -j8

This builds the Freeze library, the FreezeScript utilities, and all Freeze
This builds the Freeze library, the FreezeScript utilities, and all Freeze
tests and demos.

## Running the Test Suite
Expand Down Expand Up @@ -69,7 +69,7 @@ After installation, make sure that the `<prefix>/bin` directory is in your
`PATH`.

If you choose to not embed a `runpath` into executables at build time (see your
build settings in `freeze/ice/config/Make.rules`) or did not create a symbolic link
build settings in `freeze/ice/config/Make.rules`) or did not create a symbolic link
from the `runpath` directory to the installation directory, you also need to add the
library directory to your `DYLD_LIBRARY_PATH`.

Expand Down
6 changes: 3 additions & 3 deletions cpp/BuildInstructionsWindows.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ TBD

Freeze relies on [Oracle Berkeley DB][2] as its datastore.

The Freeze build system for Windows automatically downloads and installs
[Nuget][3] and Nuget packages for Berkeley DB when you build Freeze for C++.
The Freeze build system for Windows automatically downloads and installs
[Nuget][3] and Nuget packages for Berkeley DB when you build Freeze for C++.
These packages are installed in `freeze\cpp\msbuild\packages`.

## Building Freeze for C++
Expand Down Expand Up @@ -51,7 +51,7 @@ mode.
msbuild msbuild\freeze.proj /p:BuildAllConfigurations=yes

This builds all platforms (x64, Win32) and configurations (Debug, Release)
of several Ice C++ components in `freeze\ice\cpp`, the Freeze library, the
of several Ice C++ components in `freeze\ice\cpp`, the Freeze library, the
FreezeScript utilities and all the Freeze tests.

## Running the Test Suite
Expand Down
16 changes: 8 additions & 8 deletions cpp/demo/Freeze/backup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ DB utility names
----------------

The Berkeley DB utilities are usually named db_hotbackup, db_archive,
db_recover, etc. If you use the Berkeley DB 5.3.28 RPMs provided
by ZeroC, the utility names are db53_hotbackup, db53_archive, etc.
db_recover, etc. If you use the Berkeley DB 5.3.28 RPMs provided
by ZeroC, the utility names are db53_hotbackup, db53_archive, etc.
Please adjust the instructions below accordingly.

DB utilities: 32 vs 64 bit
--------------------------

Berkeley DB log files are architecture-specific: the architecture of
Berkeley DB log files are architecture-specific: the architecture of
the DB utilities you use must match the architecture of the program
that creates your DB files. For example, if your client program is a
32-bit application, you need to use 32-bit DB utilities to backup or
that creates your DB files. For example, if your client program is a
32-bit application, you need to use 32-bit DB utilities to backup or
restore the DB log files generated by this program.

Some Linux distributions provide both 32-bit and 64-bit libraries for
Berkeley DB, but unfortunately only provide 64-bit DB utilities. On
Berkeley DB, but unfortunately only provide 64-bit DB utilities. On
such systems, if you build the client program in 32-bit mode, you will
need to build the 32-bit DB utilities from sources to perform hot
need to build the 32-bit DB utilities from sources to perform hot
backups and restores as described in this demo.

Backup
Expand Down Expand Up @@ -111,7 +111,7 @@ directory, you can also copy these log files over your restored log
files and perform a catastrophic recovery to recover these updates.

With the example above:

$ cp db.old/logs/log.* db/logs
$ db_recover -c -h db

Expand Down
14 changes: 7 additions & 7 deletions cpp/demo/Freeze/backup/backup
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ case $1 in

echo "====== Checkpoint ======"
${db}_checkpoint -1 -h db

if [ $1 = "full" ]
then
if [ -d hotbackup ]
then
echo "====== Preserve (move) previous hotbackup directory ======"
echo "====== Preserve (move) previous hotbackup directory ======"
if [ -d hotbackup.1 ]
then
\rm -fr hotbackup.1
fi
\mv hotbackup hotbackup.1
fi

echo "====== Retrieve list of old logs ======"
oldLogs=`${db}_archive -h db`

echo "====== Run ${db}_hotbackup ======"
${db}_hotbackup -b hotbackup -v -D -h db
status=$?
Expand All @@ -51,12 +51,12 @@ case $1 in
echo "db/logs/$i deleted"
done
fi

if [ $1 = "incremental" ]
then
if [ -d hotbackup ]
then
echo "====== Preserve (copy) previous hotbackup directory ======"
echo "====== Preserve (copy) previous hotbackup directory ======"
if [ -d hotbackup.1 ]
then
\rm -fr hotbackup.1
Expand All @@ -68,7 +68,7 @@ case $1 in
${db}_hotbackup -u -b hotbackup -v -D -h db
status=$?
if [ $status != 0 ]; then exit $status ; fi
fi
fi

;;
*) echo "Usage: $0 {full|incremental}"
Expand Down
2 changes: 1 addition & 1 deletion cpp/demo/Freeze/casino/BetResolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class BetResolver
private:

void decrementBetCount();

int _betCount;
IceUtil::Mutex _mutex;
std::vector<IceUtil::TimerPtr> _timers;
Expand Down
6 changes: 3 additions & 3 deletions cpp/demo/Freeze/casino/Casino.ice
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module Casino
// or wins more
//
interface Player
{
{
//
// The number of chips held by this player
//
Expand Down Expand Up @@ -78,13 +78,13 @@ module Casino
["cpp:const"] int getEarnings();

//
// Verify that the total number of chips held by all known players and bets;
// Verify that the total number of chips held by all known players and bets;
// match getOutstandingChips();
//
["cpp:const", "freeze:read:required"] bool checkAllChips();

//
// Create a new bet with the given amount to join; this bet ends in
// Create a new bet with the given amount to join; this bet ends in
// 'lifetime' milliseconds
//
["freeze:write"] Bet* createBet(int amount, int lifetime);
Expand Down
4 changes: 2 additions & 2 deletions cpp/demo/Freeze/casino/CasinoStore.ice
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ module CasinoStore
// The time when the bet completes (ms since the epoch)
//
long closeTime;
};
};

class PersistentBank implements Casino::Bank, Winner
{
//
Expand Down
8 changes: 4 additions & 4 deletions cpp/demo/Freeze/casino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ Highlights:
- The public interface of the server is specified in Casino.ice;
CasinoStore.ice is just an implementation detail of the server.

- This demo uses a transactional evictor per servant type; this
- This demo uses a transactional evictor per servant type; this
is more efficient than storing different types of servants in
the same Freeze transactional evictor.

- Transactions often span servants in several evictors; this works
because all the evictors use the same underlying Berkeley DB
because all the evictors use the same underlying Berkeley DB
environment.

- The application code does not deal at all with database deadlocks;
Expand All @@ -39,7 +39,7 @@ Highlights:
wins a bet and is destroyed at the same time? Will chips get lost?
In fact, there is no issue thanks to Berkeley DB locking:
when a bet picks a winner, it invokes an operation on this object
(through a proxy) within a transaction. At this point, if the
(through a proxy) within a transaction. At this point, if the
object is still alive, it's locked by the transaction, which
prevents another transaction from acquiring a write lock (for
prevents another transaction from acquiring a write lock (for
example, to destroy it).
6 changes: 3 additions & 3 deletions cpp/demo/Freeze/casino/config.server
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ Freeze.Warn.Deadlocks=1
#
# Freeze Evictor Tracing.
#
# 0 = No evictor activity trace (default).
# 0 = No evictor activity trace (default).
# 1 = Trace Ice object and facet creation and destruction, facet
# streaming time, facet saving time, object eviction (every 50
# objects) and evictor deactivation.
# 2 = Also trace object lookups, and all object evictions.
# 2 = Also trace object lookups, and all object evictions.
# 3 = Also trace object retrieval from the database.
#
#Freeze.Trace.Evictor=1
Expand All @@ -46,7 +46,7 @@ Freeze.Evictor.db.player.RollbackOnUserException=1
#
# Freeze Transaction Tracing.
#
# 0 = No transaction activity trace (default).
# 0 = No transaction activity trace (default).
# 1 = Trace transaction IDs and commit and rollback activity.
#
#Freeze.Trace.Transaction=1
Expand Down
12 changes: 6 additions & 6 deletions cpp/demo/Freeze/customEvictor/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ class ReaderThread : public IceUtil::Thread
ItemPrx item = ItemPrx::uncheckedCast(_anItem->ice_identity(identity));
item->getDescription();
}
_requestsPerSecond =
_requestsPerSecond =
static_cast<int>(readCount / (IceUtil::Time::now(IceUtil::Time::Monotonic) - startTime).toSecondsDouble());
}
catch(const IceUtil::Exception& e)
{
cerr << "Unexpected exception in ReaderThread: " << e << endl;
}
}
}

int getRequestsPerSecond() const
Expand Down Expand Up @@ -105,7 +105,7 @@ class WriterThread : public IceUtil::Thread
for(int i = 0; i < writeCount; ++i)
{
int id = rand() % objectCount;

ostringstream os;
os << "P/N " << id;
string nm = os.str();
Expand All @@ -116,13 +116,13 @@ class WriterThread : public IceUtil::Thread

item->adjustStock(1);
}
_requestsPerSecond =
_requestsPerSecond =
static_cast<int>(writeCount / (IceUtil::Time::now(IceUtil::Time::Monotonic) - startTime).toSecondsDouble());
}
catch(const IceUtil::Exception& e)
{
cerr << "Unexpected exception in WriterThread: " << e << endl;
}
}
}

int getRequestsPerSecond() const
Expand Down Expand Up @@ -176,7 +176,7 @@ WarehouseClient::run(int argc, char*[])
wt->getThreadControl().join();
for(i = 0; i < readerCount; ++i)
{
rt[i]->getThreadControl().join();
rt[i]->getThreadControl().join();
}

//
Expand Down
4 changes: 2 additions & 2 deletions cpp/demo/Freeze/customEvictor/CurrentDatabase.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
class CurrentDatabase
{
public:

CurrentDatabase(const Ice::CommunicatorPtr&, const std::string&, const std::string&);
~CurrentDatabase();

Database& get();

private:

const Ice::CommunicatorPtr _communicator;
Expand Down
14 changes: 7 additions & 7 deletions cpp/demo/Freeze/customEvictor/Evictor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ EvictorCache::load(const Ice::Identity& itemId)
// cannot acquire the Evictor mutex here, since we also call
// IceUtil::Cache with the Evictor mutex locked.
//
void
void
EvictorCache::pinned(const EvictorEntryPtr& entry, EvictorCache::Position cp)
{
entry->stale = false;
Expand All @@ -115,13 +115,13 @@ Evictor::Evictor(CurrentDatabase& currentDb, int size) :
{
}

Ice::ObjectPtr
Ice::ObjectPtr
Evictor::locate(const Ice::Current& current, Ice::LocalObjectPtr& cookie)
{
cookie = 0;

//
// Lookup the cookie (EvictorEntry) in the cache; this will call load()
// Lookup the cookie (EvictorEntry) in the cache; this will call load()
// if the entry is not yet in there.
//
// If we get an entry that was just evicted (stale == true), we try again.
Expand Down Expand Up @@ -178,8 +178,8 @@ Evictor::locate(const Ice::Current& current, Ice::LocalObjectPtr& cookie)
}
}

void
Evictor::finished(const Ice::Current& /*current*/, const Ice::ObjectPtr& /*servant*/,
void
Evictor::finished(const Ice::Current& /*current*/, const Ice::ObjectPtr& /*servant*/,
const Ice::LocalObjectPtr& cookie)
{
if(cookie != 0)
Expand All @@ -193,10 +193,10 @@ Evictor::finished(const Ice::Current& /*current*/, const Ice::ObjectPtr& /*serva
assert(entry->useCount >= 0);

evict();
}
}
}

void
void
Evictor::deactivate(const string& /*category*/)
{
Mutex::Lock lock(_mutex);
Expand Down
Loading

0 comments on commit 71260a4

Please sign in to comment.