[SCM] BOINC packaging branch, master, updated. debian/6.10.17+dfsg-3-347-g96da082
Steffen Moeller
moeller at debian.org
Tue Dec 6 21:45:06 UTC 2011
The following commit has been merged in the master branch:
commit 8b91e3ac0a1173882ebd796acc9483a95b44f6b1
Author: Steffen Moeller <moeller at debian.org>
Date: Fri Dec 2 03:04:51 2011 +0100
Patches likely soon to be removed again.
diff --git a/debian/patches/andYetMorePatches04.patch b/debian/patches/andYetMorePatches04.patch
new file mode 100644
index 0000000..9eb0af3
--- /dev/null
+++ b/debian/patches/andYetMorePatches04.patch
@@ -0,0 +1,1189 @@
+Index: boinc/lib/url.cpp
+===================================================================
+--- boinc.orig/lib/url.cpp 2011-11-26 19:31:03.000000000 +0100
++++ boinc/lib/url.cpp 2011-11-26 19:32:54.000000000 +0100
+@@ -25,6 +25,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <ctype.h>
++#include <assert.h>
+ #endif
+
+ #include "str_util.h"
+@@ -38,7 +39,7 @@
+ // URL format:
+ // [{http|https|socks}://][user[:passwd]@]host.dom.dom[:port][/dir/file]
+ //
+-void parse_url(const char* url, PARSED_URL& purl) {
++void parse_url(const char* const url, PARSED_URL& purl) {
+ char* p, *q, *buf;
+ char _buf[256];
+
+@@ -105,7 +106,7 @@
+ strcpy(purl.host, buf);
+ }
+
+-static char x2c(char *what) {
++static char x2c(const char *const what) {
+ register char digit;
+
+ digit = (what[0] >= 'A' ? ((what[0] & 0xdf) - 'A')+10 : (what[0] - '0'));
+@@ -114,7 +115,7 @@
+ return(digit);
+ }
+
+-void c2x(char *what) {
++void c2x(char *const what) {
+ char buf[3];
+ char num = atoi(what);
+ char d1 = num / 16;
+@@ -131,7 +132,7 @@
+ strcpy(what, buf);
+ }
+
+-void unescape_url(char *url) {
++void unescape_url(char *const url) {
+ int x,y;
+
+ for (x=0,y=0;url[y];++x,++y) {
+@@ -143,7 +144,7 @@
+ url[x] = '\0';
+ }
+
+-void unescape_url_safe(char *url, int url_size) {
++void unescape_url_safe(char *const url, const int url_size) {
+ int x,y;
+
+ for (x=0,y=0; url[y] && (x<url_size);++x,++y) {
+@@ -164,7 +165,7 @@
+ url = buf;
+ }
+
+-void escape_url(char *in, char*out) {
++void escape_url(const char *const in, char*const out) {
+ int x, y;
+ for (x=0, y=0; in[x]; ++x) {
+ if (isalnum(in[x])) {
+@@ -184,7 +185,7 @@
+ out[y] = 0;
+ }
+
+-void escape_url_safe(const char *in, char*out, int out_size) {
++void escape_url_safe(const char *const in, char* const out, const int out_size) {
+ int x, y;
+ for (x=0, y=0; in[x] && (y<out_size); ++x) {
+ if (isalnum(in[x])) {
+@@ -213,17 +214,22 @@
+ }
+
+ // Escape a URL for the project directory, cutting off the "http://",
++// or any other protocol identifier preceeding the "://" separator,
+ // converting everthing other than alphanumbers, ., - and _ to "_".
+ //
+-void escape_url_readable(char *in, char* out) {
+- int x, y;
+- char *temp;
++void escape_url_readable(const char *const inOrig, char* const out) {
++
++ assert(inOrig);
++ assert(out);
+
+- temp = strstr(in,"://");
++ const char *in = inOrig;
++ const char *temp = strstr(inOrig,"://");
+ if (temp) {
+- in = temp + strlen("://");
++ in = temp + strlen("://");
+ }
+- for (x=0, y=0; in[x]; ++x) {
++
++ int y=0;
++ for (int x=0; in[x]; ++x) {
+ if (isalnum(in[x]) || in[x]=='.' || in[x]=='-' || in[x]=='_') {
+ out[y] = in[x];
+ ++y;
+@@ -242,7 +248,7 @@
+ // - Remove double slashes in the rest
+ // - Add a trailing slash if necessary
+ //
+-void canonicalize_master_url(char* url) {
++void canonicalize_master_url(char* const url) {
+ char buf[1024];
+ size_t n;
+ bool bSSL = false; // keep track if they sent in https://
+@@ -275,7 +281,7 @@
+
+ // is the string a valid master URL, in canonical form?
+ //
+-bool valid_master_url(char* buf) {
++bool valid_master_url(char* const buf) {
+ char* p, *q;
+ size_t n;
+ bool bSSL = false;
+@@ -303,7 +309,7 @@
+ return true;
+ }
+
+-void escape_project_url(char *in, char* out) {
++void escape_project_url(const char *const in, char* const out) {
+ escape_url_readable(in, out);
+ char& last = out[strlen(out)-1];
+ // remove trailing _
+Index: boinc/lib/url.h
+===================================================================
+--- boinc.orig/lib/url.h 2011-11-26 19:31:03.000000000 +0100
++++ boinc/lib/url.h 2011-11-26 19:32:54.000000000 +0100
+@@ -32,15 +32,15 @@
+ char file[256];
+ };
+
+-extern void parse_url(const char* url, PARSED_URL&);
++extern void parse_url(const char* const url, PARSED_URL&);
+ extern void unescape_url(std::string& url);
+-extern void unescape_url(char *url);
++extern void unescape_url(char *const url);
+ extern void escape_url(std::string& url);
+-extern void escape_url(char *in, char*out);
+-extern void escape_url_readable(char* in, char* out);
+-extern void escape_project_url(char *in, char* out);
+-extern bool valid_master_url(char*);
+-extern void canonicalize_master_url(char *url);
++extern void escape_url(const char *const in, char* const out);
++extern void escape_url_readable(const char* const in, char* const out);
++extern void escape_project_url(const char *const in, char* const out);
++extern bool valid_master_url(char* const);
++extern void canonicalize_master_url(char *const url);
+ extern void canonicalize_master_url(std::string&);
+
+ #endif
+Index: boinc/lib/crypt.cpp
+===================================================================
+--- boinc.orig/lib/crypt.cpp 2011-11-26 20:24:29.000000000 +0100
++++ boinc/lib/crypt.cpp 2011-11-27 01:36:37.000000000 +0100
+@@ -63,7 +63,7 @@
+ // NOTE: since length may not be known to the reader,
+ // we follow the data with a non-hex character '.'
+ //
+-int print_hex_data(FILE* f, DATA_BLOCK& x) {
++int print_hex_data(FILE* const f, const DATA_BLOCK& x) {
+ unsigned int i;
+
+ for (i=0; i<x.len; i++) {
+@@ -77,7 +77,7 @@
+
+ // same, but write to buffer
+ //
+-int sprint_hex_data(char* out_buf, DATA_BLOCK& x) {
++int sprint_hex_data(char* const out_buf, DATA_BLOCK& x) {
+ unsigned int i;
+ const char hex[] = "0123456789abcdef";
+ char* p = out_buf;
+@@ -93,7 +93,7 @@
+ return 0;
+ }
+
+-int print_raw_data(FILE* f, DATA_BLOCK& x) {
++int print_raw_data(FILE* const f, DATA_BLOCK& x) {
+ unsigned int i;
+ for (i=0; i<x.len; i++) {
+ //printf("%x ", x.data[i]);
+@@ -103,7 +103,7 @@
+ }
+
+ // NOTE: buffer must be big enough; no checking is done.
+-int scan_raw_data(FILE *f, DATA_BLOCK& x) {
++int scan_raw_data(FILE *const f, DATA_BLOCK& x) {
+ int i=0,j;
+ while(EOF!=(j=fgetc(f))) {
+ x.data[i]=j;
+@@ -117,7 +117,7 @@
+ // stop when you reach a non-parsed character.
+ // NOTE: buffer must be big enough; no checking is done.
+ //
+-int scan_hex_data(FILE* f, DATA_BLOCK& x) {
++int scan_hex_data(FILE* const f, DATA_BLOCK& x) {
+ int n;
+
+ x.len = 0;
+@@ -173,18 +173,20 @@
+
+ // print a key in ASCII form
+ //
+-int print_key_hex(FILE* f, KEY* key, int size) {
++int print_key_hex(FILE* const f, KEY* const key, const int size) {
+ int len;
+- DATA_BLOCK x;
+-
+ fprintf(f, "%d\n", key->bits);
+ len = size - sizeof(key->bits);
+- x.data = key->data;
+- x.len = len;
++
++ const DATA_BLOCK x = {
++ key->data,
++ len
++ };
++
+ return print_hex_data(f, x);
+ }
+
+-int scan_key_hex(FILE* f, KEY* key, int size) {
++int scan_key_hex(FILE* const f, KEY* const key, const int size) {
+ int len, i, n;
+ int num_bits;
+
+@@ -222,7 +224,7 @@
+
+ // parse a text-encoded key from a memory buffer
+ //
+-int sscan_key_hex(const char* buf, KEY* key, int size) {
++int sscan_key_hex(const char* buf, KEY* const key, const int size) {
+ int n, retval,num_bits;
+ DATA_BLOCK db;
+
+@@ -246,7 +248,7 @@
+ // The output buffer must be at least MIN_OUT_BUFFER_SIZE.
+ // The output block must be decrypted in its entirety.
+ //
+-int encrypt_private(R_RSA_PRIVATE_KEY& key, DATA_BLOCK& in, DATA_BLOCK& out) {
++int encrypt_private(const R_RSA_PRIVATE_KEY& key, const DATA_BLOCK& in, DATA_BLOCK& out) {
+ int n, modulus_len, retval;
+
+ modulus_len = (key.bits+7)/8;
+@@ -266,7 +268,7 @@
+ return 0;
+ }
+
+-int decrypt_public(R_RSA_PUBLIC_KEY& key, DATA_BLOCK& in, DATA_BLOCK& out) {
++int decrypt_public(const R_RSA_PUBLIC_KEY& key, const DATA_BLOCK& in, DATA_BLOCK& out) {
+ int retval;
+ RSA* rp = RSA_new();
+ public_to_openssl(key, rp);
+@@ -280,7 +282,7 @@
+ return 0;
+ }
+
+-int sign_file(const char* path, R_RSA_PRIVATE_KEY& key, DATA_BLOCK& signature) {
++int sign_file(const char* const path, const R_RSA_PRIVATE_KEY& key, DATA_BLOCK& signature) {
+ char md5_buf[MD5_LEN];
+ double file_length;
+ DATA_BLOCK in_block;
+@@ -295,7 +297,7 @@
+ return 0;
+ }
+
+-int sign_block(DATA_BLOCK& data_block, R_RSA_PRIVATE_KEY& key, DATA_BLOCK& signature) {
++int sign_block(DATA_BLOCK& data_block, const R_RSA_PRIVATE_KEY& key, DATA_BLOCK& signature) {
+ char md5_buf[MD5_LEN];
+ int retval;
+ DATA_BLOCK in_block;
+@@ -314,7 +316,7 @@
+ // compute an XML signature element for some text
+ //
+ int generate_signature(
+- char* text_to_sign, char* signature_hex, R_RSA_PRIVATE_KEY& key
++ const char* const text_to_sign, char* signature_hex, const R_RSA_PRIVATE_KEY& key
+ ) {
+ DATA_BLOCK block, signature_data;
+ unsigned char signature_buf[SIGNATURE_SIZE_BINARY];
+@@ -331,7 +333,7 @@
+ }
+
+ int verify_file(
+- const char* path, R_RSA_PUBLIC_KEY& key, DATA_BLOCK& signature, bool& answer
++ const char* const path, const R_RSA_PUBLIC_KEY& key, const DATA_BLOCK& signature, bool& answer
+ ) {
+ char md5_buf[MD5_LEN], clear_buf[MD5_LEN];
+ double file_length;
+@@ -356,7 +358,7 @@
+ }
+
+ int verify_file2(
+- const char* path, const char* signature_text, const char* key_text, bool& answer
++ const char* const path, const char* const signature_text, const char* const key_text, bool& answer
+ ) {
+ R_RSA_PUBLIC_KEY key;
+ unsigned char signature_buf[SIGNATURE_SIZE_BINARY];
+@@ -378,7 +380,7 @@
+ // verify, where both text and signature are char strings
+ //
+ int verify_string(
+- const char* text, const char* signature_text, R_RSA_PUBLIC_KEY& key, bool& answer
++ const char* const text, const char* const signature_text, const R_RSA_PUBLIC_KEY& key, bool& answer
+ ) {
+ char md5_buf[MD5_LEN];
+ unsigned char signature_buf[SIGNATURE_SIZE_BINARY];
+@@ -404,7 +406,7 @@
+ // Same, where public key is also encoded as text
+ //
+ int verify_string2(
+- const char* text, const char* signature_text, const char* key_text, bool& answer
++ const char* const text, const char* const signature_text, const char* const key_text, bool& answer
+ ) {
+ R_RSA_PUBLIC_KEY key;
+ int retval;
+@@ -441,7 +443,7 @@
+ }
+
+ void openssl_to_keys(
+- RSA* rp, int nbits, R_RSA_PRIVATE_KEY& priv, R_RSA_PUBLIC_KEY& pub
++ const RSA* const rp, int nbits, R_RSA_PRIVATE_KEY& priv, R_RSA_PUBLIC_KEY& pub
+ ) {
+ pub.bits = nbits;
+ bn_to_bin(rp->n, pub.modulus, sizeof(pub.modulus));
+@@ -459,7 +461,7 @@
+ bn_to_bin(rp->iqmp, priv.coefficient, sizeof(priv.coefficient));
+ }
+
+-void private_to_openssl(R_RSA_PRIVATE_KEY& priv, RSA* rp) {
++void private_to_openssl(const R_RSA_PRIVATE_KEY& priv, RSA* rp) {
+ rp->n = BN_bin2bn(priv.modulus, sizeof(priv.modulus), 0);
+ rp->e = BN_bin2bn(priv.publicExponent, sizeof(priv.publicExponent), 0);
+ rp->d = BN_bin2bn(priv.exponent, sizeof(priv.exponent), 0);
+@@ -470,7 +472,7 @@
+ rp->iqmp = BN_bin2bn(priv.coefficient, sizeof(priv.coefficient), 0);
+ }
+
+-void public_to_openssl(R_RSA_PUBLIC_KEY& pub, RSA* rp) {
++void public_to_openssl(const R_RSA_PUBLIC_KEY& pub, RSA* rp) {
+ rp->n = BN_bin2bn(pub.modulus, sizeof(pub.modulus), 0);
+ rp->e = BN_bin2bn(pub.exponent, sizeof(pub.exponent), 0);
+ }
+@@ -509,8 +511,8 @@
+ }
+
+ int check_validity_of_cert(
+- const char *cFile, const unsigned char *md5_md, unsigned char *sfileMsg,
+- const int sfsize, const char* caPath
++ const char *const cFile, const unsigned char *md5_md, const unsigned char *sfileMsg,
++ const int sfsize, const char* const caPath
+ ) {
+ int retval = 0;
+ X509 *cert;
+@@ -577,8 +579,8 @@
+ }
+
+ char *check_validity(
+- const char *certPath, const char *origFile, unsigned char *signature,
+- char* caPath
++ const char *const certPath, const char *const origFile, const unsigned char *const signature,
++ const char* const caPath
+ ) {
+ MD5_CTX md5CTX;
+ int rbytes;
+@@ -617,7 +619,7 @@
+ }
+
+ int cert_verify_file(
+- CERT_SIGS* signatures, const char* origFile, const char* trustLocation
++ const CERT_SIGS* const signatures, const char* const origFile, const char* const trustLocation
+ ) {
+ MD5_CTX md5CTX;
+ int rbytes;
+Index: boinc/lib/crypt.h
+===================================================================
+--- boinc.orig/lib/crypt.h 2011-10-08 14:11:56.000000000 +0200
++++ boinc/lib/crypt.h 2011-12-02 02:55:14.000000000 +0100
+@@ -54,9 +54,9 @@
+ extern void openssl_to_keys(
+ RSA* rp, int nbits, R_RSA_PRIVATE_KEY& priv, R_RSA_PUBLIC_KEY& pub
+ );
+-extern void private_to_openssl(R_RSA_PRIVATE_KEY& priv, RSA* rp);
+-extern void public_to_openssl(R_RSA_PUBLIC_KEY& pub, RSA* rp);
+-extern int openssl_to_private(RSA *from, R_RSA_PRIVATE_KEY *to);
++extern void private_to_openssl(const R_RSA_PRIVATE_KEY& priv, RSA* rp);
++extern void public_to_openssl(const R_RSA_PUBLIC_KEY& pub, RSA* rp);
++extern int openssl_to_private(const RSA *const from, R_RSA_PRIVATE_KEY *to);
+
+ struct KEY {
+ unsigned short int bits;
+@@ -76,47 +76,47 @@
+
+ // size of text-encoded signature
+ #define SIGNATURE_SIZE_TEXT (SIGNATURE_SIZE_BINARY*2+20)
+-extern int sprint_hex_data(char* p, DATA_BLOCK&);
++extern int sprint_hex_data(const char* const p, const DATA_BLOCK&);
+ #ifdef _USING_FCGI_
+ #undef FILE
+ #endif
+-extern int print_hex_data(FILE* f, DATA_BLOCK&);
+-extern int scan_hex_data(FILE* f, DATA_BLOCK&);
+-extern int print_key_hex(FILE*, KEY* key, int len);
+-extern int scan_key_hex(FILE*, KEY* key, int len);
++extern int print_hex_data(FILE* const f, const DATA_BLOCK&);
++extern int scan_hex_data(FILE* const f, DATA_BLOCK&);
++extern int print_key_hex(FILE* const, const KEY* const key, const int len);
++extern int scan_key_hex(FILE* const, KEY* key, const int len);
+ #ifdef _USING_FCGI_
+ #define FILE FCGI_FILE
+ #endif
+-extern int sscan_key_hex(const char*, KEY* key, int len);
++extern int sscan_key_hex(const char*, KEY* const key, const int len);
+ extern int encrypt_private(
+- R_RSA_PRIVATE_KEY& key, DATA_BLOCK& in, DATA_BLOCK& out
++ const R_RSA_PRIVATE_KEY& key, const DATA_BLOCK& in, DATA_BLOCK& out
+ );
+ extern int decrypt_public(
+- R_RSA_PUBLIC_KEY& key, DATA_BLOCK& in, DATA_BLOCK& out
++ const R_RSA_PUBLIC_KEY& key, DATA_BLOCK& in, DATA_BLOCK& out
+ );
+ extern int sign_file(
+- const char* path, R_RSA_PRIVATE_KEY&, DATA_BLOCK& signature
++ const char* const path, const R_RSA_PRIVATE_KEY&, DATA_BLOCK& signature
+ );
+ extern int sign_block(
+- DATA_BLOCK& data, R_RSA_PRIVATE_KEY&, DATA_BLOCK& signature
++ const DATA_BLOCK& data, const R_RSA_PRIVATE_KEY&, DATA_BLOCK& signature
+ );
+ extern int verify_file(
+- const char* path, R_RSA_PUBLIC_KEY&, DATA_BLOCK& signature, bool&
++ const char* const path, const R_RSA_PUBLIC_KEY&, const DATA_BLOCK& signature, bool&
+ );
+ extern int verify_file2(
+- const char* path, const char* signature, const char* key, bool&
++ const char* const path, const char* const signature, const char* const key, bool&
+ );
+ extern int verify_string(
+- const char* text, const char* signature, R_RSA_PUBLIC_KEY&, bool&
++ const char* const text, const char* const signature, const R_RSA_PUBLIC_KEY&, bool&
+ );
+ extern int verify_string2(
+- const char* text, const char* signature, const char* key, bool&
++ const char* const text, const char* const signature, const char* const key, bool&
+ );
+-extern int print_raw_data(FILE* f, DATA_BLOCK& x);
+-extern int scan_raw_data(FILE *f, DATA_BLOCK& x);
+-extern int read_key_file(const char* keyfile, R_RSA_PRIVATE_KEY& key);
++extern int print_raw_data(FILE* const f,const DATA_BLOCK& x);
++extern int scan_raw_data(FILE* const f, DATA_BLOCK& x);
++extern int read_key_file(const char* const keyfile, R_RSA_PRIVATE_KEY& key);
+ extern int generate_signature(
+- char* text_to_sign, char* signature_hex, R_RSA_PRIVATE_KEY& key
++ const char* const text_to_sign, char* signature_hex, const R_RSA_PRIVATE_KEY& key
+ );
+
+ // Check if sfileMsg (of length sfsize) has been created from sha1_md using the
+@@ -125,17 +125,17 @@
+ // 1: YES
+ // 0: NO or error
+ extern int check_validity_of_cert(
+- const char *cFile, const unsigned char *sha1_md,
+- unsigned char *sfileMsg, const int sfsize, const char* caPath
++ const char *const cFile, const unsigned char* const sha1_md,
++ const unsigned char *const sfileMsg, const int sfsize, const char* const caPath
+ );
+
+-extern char *check_validity(const char *certPath, const char *origFile,
+- unsigned char *signature, char* caPath
++extern char *check_validity(const char *const certPath, const char *const origFile,
++ const unsigned char *const signature, const char* const caPath
+ );
+
+ struct CERT_SIGS;
+
+ int cert_verify_file(
+- CERT_SIGS* signatures, const char* origFile, const char* trustLocation
++ const CERT_SIGS* const signatures, const char* const origFile, const char* const trustLocation
+ );
+ #endif
+Index: boinc/lib/filesys.cpp
+===================================================================
+--- boinc.orig/lib/filesys.cpp 2011-11-26 00:34:25.000000000 +0100
++++ boinc/lib/filesys.cpp 2011-11-26 20:19:13.000000000 +0100
+@@ -85,7 +85,7 @@
+
+ // routines for enumerating the entries in a directory
+
+-int is_file(const char* path) {
++int is_file(const char* const path) {
+ struct stat sbuf;
+ #ifdef _WIN32
+ int retval = stat(path, &sbuf);
+@@ -95,7 +95,7 @@
+ return (!retval && (((sbuf.st_mode) & S_IFMT) == S_IFREG));
+ }
+
+-int is_dir(const char* path) {
++int is_dir(const char* const path) {
+ struct stat sbuf;
+ #ifdef _WIN32
+ int retval = stat(path, &sbuf);
+@@ -106,7 +106,7 @@
+ }
+
+ #ifndef _WIN32
+-int is_symlink(const char* path) {
++int is_symlink(const char* const path) {
+ struct stat sbuf;
+ int retval = lstat(path, &sbuf);
+ return (!retval && S_ISLNK(sbuf.st_mode));
+@@ -115,7 +115,7 @@
+
+ // Open a directory
+ //
+-DIRREF dir_open(const char* p) {
++DIRREF dir_open(const char* const p) {
+ DIRREF dirp;
+ #ifdef _WIN32
+ if (!is_dir(p)) return NULL;
+@@ -198,7 +198,7 @@
+ #endif
+ }
+
+-bool is_dir_empty(const char *p) {
++bool is_dir_empty(const char *const p) {
+ char file[256];
+
+ DIRREF dir = dir_open(p);
+@@ -278,7 +278,7 @@
+ #endif
+ }
+
+-static int boinc_delete_file_aux(const char* path) {
++static int boinc_delete_file_aux(const char* const path) {
+ #ifdef _WIN32
+ if (!DeleteFileA(path)) {
+ return ERR_UNLINK;
+@@ -292,7 +292,7 @@
+
+ // Delete the file located at path
+ //
+-int boinc_delete_file(const char* path) {
++int boinc_delete_file(const char* const path) {
+ int retval = 0;
+
+ if (!boinc_file_exists(path)) {
+@@ -316,7 +316,7 @@
+
+ // get file size
+ //
+-int file_size(const char* path, double& size) {
++int file_size(const char* const path, double& size) {
+ struct stat sbuf;
+ int retval;
+
+@@ -326,7 +326,7 @@
+ return 0;
+ }
+
+-int boinc_truncate(const char* path, double size) {
++int boinc_truncate(const char* const path, const double size) {
+ int retval;
+ #if defined(_WIN32) && !defined(__CYGWIN32__)
+ // the usual Windows nightmare.
+@@ -347,7 +347,7 @@
+
+ // remove everything from specified directory
+ //
+-int clean_out_dir(const char* dirpath) {
++int clean_out_dir(const char* const dirpath) {
+ char filename[256], path[256];
+ int retval;
+ DIRREF dirp;
+@@ -375,7 +375,7 @@
+ // Win: use special version because stat() is slow, can be avoided
+ // Unix: follow symbolic links
+ //
+-int dir_size(const char* dirpath, double& size, bool recurse) {
++int dir_size(const char* const dirpath, double& size, const bool recurse) {
+ #ifdef WIN32
+ char path2[_MAX_PATH];
+ sprintf(path2, "%s/*", dirpath);
+@@ -430,7 +430,7 @@
+ return 0;
+ }
+
+-FILE* boinc_fopen(const char* path, const char* mode) {
++FILE* boinc_fopen(const char* const path, const char* const mode) {
+ // if opening for read, and file isn't there,
+ // leave now (avoid 5-second delay!!)
+ //
+@@ -481,7 +481,7 @@
+ }
+
+
+-int boinc_file_exists(const char* path) {
++int boinc_file_exists(const char* const path) {
+ struct stat buf;
+ if (stat(path, &buf)) {
+ return false; // stat() returns zero on success
+@@ -491,7 +491,7 @@
+
+ // same, but doesn't traverse symlinks
+ //
+-int boinc_file_or_symlink_exists(const char* path) {
++int boinc_file_or_symlink_exists(const char* const path) {
+ struct stat buf;
+ #ifdef _WIN32
+ if (stat(path, &buf)) {
+@@ -505,7 +505,7 @@
+
+ // returns zero on success, nonzero if didn't touch file
+ //
+-int boinc_touch_file(const char *path) {
++int boinc_touch_file(const char *const path) {
+
+ if (boinc_file_exists(path)) {
+ return 0;
+@@ -522,7 +522,7 @@
+ return -1;
+ }
+
+-int boinc_copy(const char* orig, const char* newf) {
++int boinc_copy(const char* const orig, const char* const newf) {
+ #ifdef _WIN32
+ if (!CopyFileA(orig, newf, FALSE)) { // FALSE means overwrite OK
+ return GetLastError();
+@@ -570,7 +570,7 @@
+ #endif
+ }
+
+-static int boinc_rename_aux(const char* old, const char* newf) {
++static int boinc_rename_aux(const char* const old, const char* const newf) {
+ #ifdef _WIN32
+ if (MoveFileExA(old, newf, MOVEFILE_REPLACE_EXISTING|MOVEFILE_WRITE_THROUGH)) return 0;
+ return GetLastError();
+@@ -581,7 +581,7 @@
+ #endif
+ }
+
+-int boinc_rename(const char* old, const char* newf) {
++int boinc_rename(const char* const old, const char* const newf) {
+ int retval=0;
+
+ retval = boinc_rename_aux(old, newf);
+@@ -598,7 +598,7 @@
+
+ // make a dir that's owner and group RWX
+ //
+-int boinc_mkdir(const char* path) {
++int boinc_mkdir(const char* const path) {
+ if (is_dir(path)) return 0;
+ #ifdef _WIN32
+ if (!CreateDirectoryA(path, NULL)) {
+@@ -613,7 +613,7 @@
+ return 0;
+ }
+
+-int boinc_rmdir(const char* name) {
++int boinc_rmdir(const char* const name) {
+ #ifdef _WIN32
+ if (!RemoveDirectoryA(name)) {
+ return ERR_RMDIR;
+@@ -626,7 +626,7 @@
+ }
+
+ #ifndef _WIN32
+-int boinc_chown(const char* path, gid_t gid) {
++int boinc_chown(const char* const path, const gid_t gid) {
+ if (gid) {
+ if (chown(path, (uid_t)-1, gid)) {
+ return ERR_CHOWN;
+@@ -639,7 +639,7 @@
+ // if "filepath" is of the form a/b/c,
+ // create directories dirpath/a, dirpath/a/b etc.
+ //
+-int boinc_make_dirs(const char* dirpath, const char* filepath) {
++int boinc_make_dirs(const char* const dirpath, const char* const filepath) {
+ char buf[1024], oldpath[1024], newpath[1024];
+ int retval;
+ char *p, *q;
+@@ -676,7 +676,7 @@
+ #endif
+ }
+
+-int FILE_LOCK::lock(const char* filename) {
++int FILE_LOCK::lock(const char* const filename) {
+ #if defined(_WIN32) && !defined(__CYGWIN32__)
+ handle = CreateFileA(
+ filename, GENERIC_WRITE,
+@@ -706,7 +706,7 @@
+ return 0;
+ }
+
+-int FILE_LOCK::unlock(const char* filename) {
++int FILE_LOCK::unlock(const char* const filename) {
+ #if defined(_WIN32) && !defined(__CYGWIN32__)
+ CloseHandle(handle);
+ #else
+@@ -730,7 +730,7 @@
+ #endif
+ }
+
+-void relative_to_absolute(const char* relname, char* path) {
++void relative_to_absolute(const char* const relname, char* path) {
+ boinc_getcwd(path);
+ if (strlen(relname)) {
+ strcat(path, "/");
+@@ -741,7 +741,7 @@
+ // get total and free space on current filesystem (in bytes)
+ //
+ #ifdef _WIN32
+-int get_filesystem_info(double &total_space, double &free_space, char*) {
++int get_filesystem_info(double &total_space, double &free_space, const char* const) {
+ char buf[256];
+ boinc_getcwd(buf);
+ FreeFn pGetDiskFreeSpaceEx;
+@@ -774,7 +774,7 @@
+ total_space = (double)dwTotalClusters * dwSectPerClust * dwBytesPerSect;
+ }
+ #else
+-int get_filesystem_info(double &total_space, double &free_space, char* path) {
++int get_filesystem_info(double &total_space, double &free_space, const char* const path) {
+ #ifdef STATFS
+ struct STATFS fs_info;
+
+@@ -795,7 +795,7 @@
+
+ #ifndef _WIN32
+
+-int get_file_dir(char* filename, char* dir) {
++int get_file_dir(const char* const filename, char* const dir) {
+ char buf[8192], *p, path[256];
+ struct stat sbuf;
+ int retval;
+Index: boinc/lib/filesys.h
+===================================================================
+--- boinc.orig/lib/filesys.h 2011-07-24 19:39:09.000000000 +0200
++++ boinc/lib/filesys.h 2011-11-26 20:19:30.000000000 +0100
+@@ -43,26 +43,26 @@
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+- extern int boinc_delete_file(const char*);
+- extern int boinc_touch_file(const char *path);
+- extern FILE* boinc_fopen(const char* path, const char* mode);
+- extern int boinc_copy(const char* orig, const char* newf);
+- extern int boinc_rename(const char* old, const char* newf);
+- extern int boinc_mkdir(const char*);
++ extern int boinc_delete_file(const char* const);
++ extern int boinc_touch_file(const char * const path);
++ extern FILE* boinc_fopen(const char* const path, const char* const mode);
++ extern int boinc_copy(const char* const orig, const char* const newf);
++ extern int boinc_rename(const char* const old, const char* const newf);
++ extern int boinc_mkdir(const char* const );
+ #ifndef _WIN32
+- extern int boinc_chown(const char*, gid_t);
++ extern int boinc_chown(const char* const , const gid_t);
+ #endif
+- extern int boinc_rmdir(const char*);
+- extern void boinc_getcwd(char*);
+- extern void relative_to_absolute(const char* relname, char* path);
+- extern int boinc_make_dirs(const char*, const char*);
++ extern int boinc_rmdir(const char* const);
++ extern void boinc_getcwd(char* const);
++ extern void relative_to_absolute(const char* const relname, char* const path);
++ extern int boinc_make_dirs(const char* const, const char* const);
+ extern char boinc_failed_file[256];
+- extern int is_file(const char* path);
+- extern int is_dir(const char* path);
+- extern int is_symlink(const char* path);
+- extern int boinc_truncate(const char*, double);
+- extern int boinc_file_exists(const char* path);
+- extern int boinc_file_or_symlink_exists(const char* path);
++ extern int is_file(const char* const path);
++ extern int is_dir(const char* const path);
++ extern int is_symlink(const char* const path);
++ extern int boinc_truncate(const char* const, const double);
++ extern int boinc_file_exists(const char* const path);
++ extern int boinc_file_or_symlink_exists(const char* const path);
+
+ #ifdef __cplusplus
+ }
+@@ -71,10 +71,10 @@
+ /* C++ specific prototypes/defines follow here */
+ #ifdef __cplusplus
+
+-extern int file_size(const char*, double&);
+-extern int clean_out_dir(const char*);
+-extern int dir_size(const char* dirpath, double&, bool recurse=true);
+-extern int get_filesystem_info(double& total, double& free, char* path=const_cast<char *>("."));
++extern int file_size(const char* const, double&);
++extern int clean_out_dir(const char* const);
++extern int dir_size(const char* const dirpath, double&, const bool recurse=true);
++extern int get_filesystem_info(double& total, double& free, char* const path=const_cast<char *>("."));
+
+ // TODO TODO TODO
+ // remove this code - the DirScanner class does the same thing.
+@@ -91,12 +91,12 @@
+ typedef DIR *DIRREF;
+ #endif
+
+-extern DIRREF dir_open(const char*);
+-extern int dir_scan(char*, DIRREF, int);
+-extern int dir_scan(std::string&, DIRREF);
++extern DIRREF dir_open(const char* const);
++extern int dir_scan(const char* const, DIRREF, const int);
++extern int dir_scan(const std::string&, DIRREF);
+ extern void dir_close(DIRREF);
+
+-extern bool is_dir_empty(const char*);
++extern bool is_dir_empty(const char* const);
+
+ class DirScanner {
+ #if defined(_WIN32) && !defined(__CYGWIN32__)
+@@ -121,15 +121,15 @@
+ bool locked;
+ FILE_LOCK();
+ ~FILE_LOCK();
+- int lock(const char* filename);
+- int unlock(const char* filename);
++ int lock(const char* const filename);
++ int unlock(const char* const filename);
+ };
+
+ #ifndef _WIN32
+
+ // search PATH, find the directory that a program is in, if any
+ //
+-extern int get_file_dir(char* filename, char* dir);
++extern int get_file_dir(const char* const filename, char* const dir);
+
+ #endif
+
+Index: boinc/lib/hostinfo.cpp
+===================================================================
+--- boinc.orig/lib/hostinfo.cpp 2011-10-08 14:11:56.000000000 +0200
++++ boinc/lib/hostinfo.cpp 2011-11-26 20:08:30.000000000 +0100
+@@ -29,6 +29,7 @@
+ #if HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
++#include <assert.h>
+ #endif
+
+ #include "util.h"
+@@ -71,7 +72,7 @@
+ strcpy(virtualbox_version, "");
+ }
+
+-int HOST_INFO::parse(XML_PARSER& xp, bool benchmarks_only) {
++int HOST_INFO::parse(XML_PARSER& xp, const bool benchmarks_only) {
+ char buf[1024];
+
+ MIOFILE& in = *(xp.f);
+@@ -128,7 +129,7 @@
+ // - app init file (net info, coprocs)
+ //
+ int HOST_INFO::write(
+- MIOFILE& out, bool include_net_info, bool include_coprocs
++ MIOFILE& out, const bool include_net_info, const bool include_coprocs
+ ) {
+ char pv[265], pm[256], pf[256], osn[256], osv[256];
+ out.printf(
+@@ -204,11 +205,14 @@
+ // which communicates its result via a file.
+ // The following functions read and write this file.
+ //
+-int HOST_INFO::parse_cpu_benchmarks(FILE* in) {
++int HOST_INFO::parse_cpu_benchmarks(FILE* const in) {
++
++ assert(in);
++
+ char buf[256];
+
+ char* p = fgets(buf, 256, in);
+- if (!p) return 0; // Fixes compiler warning
++ if (!p) return -1; // Fixes compiler warning
+ while (fgets(buf, 256, in)) {
+ if (match_tag(buf, "<cpu_benchmarks>"));
+ else if (match_tag(buf, "</cpu_benchmarks>")) return 0;
+@@ -221,7 +225,10 @@
+ return 0;
+ }
+
+-int HOST_INFO::write_cpu_benchmarks(FILE* out) {
++int HOST_INFO::write_cpu_benchmarks(FILE* const out) {
++
++ assert(out);
++
+ fprintf(out,
+ "<cpu_benchmarks>\n"
+ " <p_fpops>%f</p_fpops>\n"
+Index: boinc/lib/hostinfo.h
+===================================================================
+--- boinc.orig/lib/hostinfo.h 2011-10-30 00:27:06.000000000 +0200
++++ boinc/lib/hostinfo.h 2011-11-26 20:09:06.000000000 +0100
+@@ -70,8 +70,8 @@
+ HOST_INFO();
+ int parse(XML_PARSER&, bool benchmarks_only = false);
+ int write(MIOFILE&, bool include_net_info, bool include_coprocs);
+- int parse_cpu_benchmarks(FILE*);
+- int write_cpu_benchmarks(FILE*);
++ int parse_cpu_benchmarks(FILE* const);
++ int write_cpu_benchmarks(FILE* const);
+ void print();
+
+ bool host_is_running_on_batteries();
+Index: boinc/lib/run_app_windows.cpp
+===================================================================
+--- boinc.orig/lib/run_app_windows.cpp 2011-10-08 14:11:57.000000000 +0200
++++ boinc/lib/run_app_windows.cpp 2011-11-26 19:34:30.000000000 +0100
+@@ -179,7 +179,7 @@
+
+
+ int run_app_windows(
+- const char* dir, const char* file, int argc, char *const argv[], HANDLE& id
++ const char* const dir, const char* const file, int argc, char *const argv[], HANDLE& id
+ ) {
+ int retval;
+ PROCESS_INFORMATION process_info;
+Index: boinc/lib/run_app_windows.h
+===================================================================
+--- boinc.orig/lib/run_app_windows.h 2011-10-08 14:11:57.000000000 +0200
++++ boinc/lib/run_app_windows.h 2011-11-26 19:34:43.000000000 +0100
+@@ -22,5 +22,5 @@
+ extern void get_sandbox_account_service_token();
+
+ extern int run_app_windows(
+- const char* path, const char* cdir, int argc, char *const argv[], HANDLE&
++ const char* const path, const char* const cdir, int argc, char *const argv[], HANDLE&
+ );
+Index: boinc/lib/unix_util.cpp
+===================================================================
+--- boinc.orig/lib/unix_util.cpp 2011-10-30 00:27:06.000000000 +0200
++++ boinc/lib/unix_util.cpp 2011-11-26 20:02:19.000000000 +0100
+@@ -31,7 +31,7 @@
+ // In theory setenv() is posix, but some implementations of unix
+ // don't have it. The implementation isn't trivial because of
+ // differences in how putenv() behaves on different systems.
+-int setenv(const char *name, const char *value, int overwrite) {
++int setenv(const char *const name, const char *const value, const int overwrite) {
+ char *buf;
+ int rv;
+ // Name can't contant an equal sign.
+@@ -95,7 +95,7 @@
+
+ static FILE *stderr_null, *stdout_null;
+
+-int daemon(int nochdir, int noclose) {
++int daemon(const int nochdir, const int noclose) {
+ pid_t childpid,sessionid;
+ if (!nochdir) {
+ chdir("/");
+Index: boinc/lib/unix_util.h
+===================================================================
+--- boinc.orig/lib/unix_util.h 2011-10-30 00:27:06.000000000 +0200
++++ boinc/lib/unix_util.h 2011-11-26 20:03:12.000000000 +0100
+@@ -26,13 +26,13 @@
+ // Notice that this has an ifndef around it. If it is causing you problem,
+ // then try defining HAVE_SETENV in your configuration file.
+ #ifndef HAVE_SETENV
+-extern "C" int setenv(const char *name, const char *value, int overwrite);
++extern "C" int setenv(const char *const name, const char *const value, const int overwrite);
+ #endif
+
+ // Notice that this has an ifndef around it. If it is causing you problem,
+ // then try defining HAVE_DAEMON in your configuration file.
+ #ifndef HAVE_DAEMON
+-extern "C" int daemon(int nochdir, int noclose);
++extern "C" int daemon(const int nochdir, const int noclose);
+ #endif /* HAVE_DAEMON */
+
+ // Notice that this has an ifndef around it. If it is causing you problem,
+Index: boinc/lib/util.cpp
+===================================================================
+--- boinc.orig/lib/util.cpp 2011-10-30 00:27:06.000000000 +0200
++++ boinc/lib/util.cpp 2011-11-26 19:59:03.000000000 +0100
+@@ -112,7 +112,8 @@
+
+ // sleep for a specified number of seconds
+ //
+-void boinc_sleep(double seconds) {
++void boinc_sleep(const double& time_to_sleep) {
++ double seconds = time_to_sleep;
+ #ifdef _WIN32
+ ::Sleep((int)(1000*seconds));
+ #else
+@@ -132,7 +133,7 @@
+ #endif
+ }
+
+-void push_unique(string s, vector<string>& v) {
++void push_unique(const string& s, vector<string>& v) {
+ for (unsigned int i=0; i<v.size();i++) {
+ if (s == v[i]) return;
+ }
+@@ -234,11 +235,11 @@
+ // html/inc/credit.inc
+ //
+ void update_average(
+- double now,
+- double work_start_time, // when new work was started
++ const double now,
++ const double work_start_time, // when new work was started
+ // (or zero if no new work)
+- double work, // amount of new work
+- double half_life,
++ const double work, // amount of new work
++ const double half_life,
+ double& avg, // average work per day (in and out)
+ double& avg_time // when average was last computed
+ ) {
+@@ -289,7 +290,7 @@
+ #ifndef _WIN32
+ // (linux) return current CPU time of the given process
+ //
+-double linux_cpu_time(int pid) {
++double linux_cpu_time(const int pid) {
+ FILE *file;
+ char file_name[24];
+ unsigned long utime = 0, stime = 0;
+@@ -316,7 +317,7 @@
+
+ // read file (at most max_len chars, if nonzero) into malloc'd buf
+ //
+-int read_file_malloc(const char* path, char*& buf, size_t max_len, bool tail) {
++int read_file_malloc(const char* const path, char*& buf, const size_t max_len, const bool tail) {
+ int retval;
+ double size;
+
+@@ -355,7 +356,7 @@
+ // read file (at most max_len chars, if nonzero) into string
+ //
+ int read_file_string(
+- const char* path, string& result, size_t max_len, bool tail
++ const char* const path, string& result, const size_t max_len, const bool tail
+ ) {
+ result.erase();
+ int retval;
+@@ -376,7 +377,7 @@
+
+ #ifdef _WIN32
+ int run_program(
+- const char* dir, const char* file, int argc, char *const argv[], double nsecs, HANDLE& id
++ const char* const dir, const char* const file, int argc, char *const argv[], const double nsecs, HANDLE& id
+ ) {
+ int retval;
+ PROCESS_INFORMATION process_info;
+@@ -428,7 +429,7 @@
+ }
+ #else
+ int run_program(
+- const char* dir, const char* file, int , char *const argv[], double nsecs, int& id
++ const char* const dir, const char* const file, const int , char *const argv[], const double nsecs, int& id
+ ) {
+ int retval;
+ int pid = fork();
+@@ -486,7 +487,7 @@
+ }
+
+ #else
+-int get_exit_status(int pid) {
++int get_exit_status(const int pid) {
+ int status;
+ waitpid(pid, &status, 0);
+ return status;
+@@ -500,7 +501,7 @@
+ #endif
+
+ #ifdef _WIN32
+-static int get_client_mutex(const char*) {
++static int get_client_mutex(const char* const) {
+ char buf[MAX_PATH] = "";
+
+ // Global mutex on Win2k and later
+@@ -515,7 +516,7 @@
+ return ERR_ALREADY_RUNNING;
+ }
+ #else
+-static int get_client_mutex(const char* dir) {
++static int get_client_mutex(const char* const dir) {
+ char path[1024];
+ static FILE_LOCK file_lock;
+
+@@ -530,7 +531,7 @@
+ return 0;
+ }
+
+-int wait_client_mutex(const char* dir, double timeout) {
++int wait_client_mutex(const char* const dir, const double timeout) {
+ double start = dtime();
+ int retval = 0;
+ while (1) {
+@@ -542,7 +543,7 @@
+ return retval;
+ }
+
+-bool boinc_is_finite(double x) {
++bool boinc_is_finite(const double x) {
+ #if defined (HPUX_SOURCE)
+ return _Isfinite(x);
+ return false;
+Index: boinc/lib/util.h
+===================================================================
+--- boinc.orig/lib/util.h 2011-10-30 00:27:06.000000000 +0200
++++ boinc/lib/util.h 2011-11-26 19:59:15.000000000 +0100
+@@ -29,8 +29,8 @@
+
+ extern double dtime();
+ extern double dday();
+-extern void boinc_sleep(double);
+-extern void push_unique(std::string, std::vector<std::string>&);
++extern void boinc_sleep(const double& seconds);
++extern void push_unique(const std::string&, std::vector<std::string>&);
+
+ // NOTE: use #include <functional> to get max,min
+
+@@ -47,7 +47,7 @@
+ #ifdef _WIN32
+ #include <windows.h>
+
+-extern char* windows_error_string(char* pszBuf, int iSize);
++extern char* windows_error_string(char* pszBuf, const int iSize);
+ extern char* windows_format_error_string(
+ unsigned long dwError, char* pszBuf, int iSize
+ );
+@@ -59,10 +59,10 @@
+ //
+ static const int PROCESS_IDLE_PRIORITY = 19;
+ static const int PROCESS_MEDIUM_PRIORITY = 10;
+-extern double linux_cpu_time(int pid);
++extern double linux_cpu_time(const int pid);
+ #endif
+
+-extern void update_average(double, double, double, double, double&, double&);
++extern void update_average(const double, const double, const double, const double, double&, double&);
+
+ extern int boinc_calling_thread_cpu_time(double&);
+
+@@ -74,16 +74,16 @@
+ // Use only for non-binary files; returns null-terminated string.
+ //
+ extern int read_file_malloc(
+- const char* path, char*& result, size_t max_len=0, bool tail=false
++ const char* const path, char*& result, const size_t max_len=0, const bool tail=false
+ );
+ extern int read_file_string(
+- const char* path, std::string& result, size_t max_len=0, bool tail=false
++ const char* const path, std::string& result, const size_t max_len=0, const bool tail=false
+ );
+
+ #ifdef _WIN32
+
+ extern int run_program(
+- const char* dir, const char* file, int argc, char *const argv[], double, HANDLE&
++ const char* const dir, const char* const file, int argc, char *const argv[], const double, HANDLE&
+ );
+
+ extern void kill_program(HANDLE);
+@@ -92,14 +92,14 @@
+
+ #else
+ extern int run_program(
+- const char* dir, const char* file, int argc, char *const argv[], double, int&
++ const char* const dir, const char* const file, int argc, char *const argv[], const double, int&
+ );
+-extern void kill_program(int);
+-extern int get_exit_status(int);
+-extern bool process_exists(int);
++extern void kill_program(const int);
++extern int get_exit_status(const int);
++extern bool process_exists(const int);
+ #endif
+
+-extern int wait_client_mutex(const char* dir, double timeout);
++extern int wait_client_mutex(const char* const dir, const double timeout);
+
+ #ifdef GCL_SIMULATOR
+ extern double simtime;
diff --git a/debian/patches/series b/debian/patches/series
index 971e857..a4cb98c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -13,3 +13,5 @@ stripchart_security.patch
annoying_warning_const_image.patch
AddSomeConstToMakeClearMemoryIsNotAllocated.patch
AddingMoreConst.patch
+evenMoreConst03.patch
+#andYetMorePatches04.patch
--
BOINC packaging
More information about the pkg-boinc-commits
mailing list