From 4f8948b8f67d26726a2e53c9afe1a110c037ce4b Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 13 Dec 2010 10:48:41 +0100 Subject: [PATCH 1/1] Wip++... * use for process::rev_neigh * update setlocalversion to use -dirty suffix --- process.cpp | 4 ++++ process.h | 16 +++++++++++++--- setlocalversion | 7 +++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/process.cpp b/process.cpp index 1a9066d..e1232f2 100644 --- a/process.cpp +++ b/process.cpp @@ -49,6 +49,10 @@ process::process(int argc, char* argv[]) print_loads(logp); } +process::~process() +{ +} + int process::run() { bool one_more = true; diff --git a/process.h b/process.h index a49c6ef..5802426 100644 --- a/process.h +++ b/process.h @@ -1,8 +1,17 @@ #ifndef PROCESS_H #define PROCESS_H -#include +#define USE_UNORDERED_MAP 1 +//#undef USE_UNORDERED_MAP + #include +#ifdef USE_UNORDERED_MAP +# include +# define MAP_TEMPLATE std::tr1::unordered_map +#else +# include +# define MAP_TEMPLATE std::map +#endif #include #include "communicator.h" #include "neighbor.h" @@ -10,12 +19,13 @@ class process { public: process(int argc, char* argv[]); - ~process() { }; + ~process(); int run(); private: std::vector neigh; - std::map rev_neigh; + MAP_TEMPLATE rev_neigh; + std::vector pneigh; communicator comm; int ctrl_close_pending; diff --git a/setlocalversion b/setlocalversion index 43ac91a..221f868 100755 --- a/setlocalversion +++ b/setlocalversion @@ -1,5 +1,7 @@ #!/bin/bash +# Inspired by linux-2.6/scripts/setlocalversion + set -e FILE=localversion @@ -11,6 +13,11 @@ compute_version() fi head=$(git rev-parse --verify --short HEAD) printf "~git-%s" "$head" + # Check for uncommitted changes + if git diff-index --name-only HEAD | read dummy; then + printf '%s' "-dirty" + fi + } [ -f "$FILE" ] || touch "$FILE" -- 2.39.5