summarylogtreecommitdiffstats
path: root/0005-remove-all-the-remaining-unnecessary-stuff.patch
diff options
context:
space:
mode:
Diffstat (limited to '0005-remove-all-the-remaining-unnecessary-stuff.patch')
-rw-r--r--0005-remove-all-the-remaining-unnecessary-stuff.patch86
1 files changed, 86 insertions, 0 deletions
diff --git a/0005-remove-all-the-remaining-unnecessary-stuff.patch b/0005-remove-all-the-remaining-unnecessary-stuff.patch
new file mode 100644
index 000000000000..a1f478b6b92b
--- /dev/null
+++ b/0005-remove-all-the-remaining-unnecessary-stuff.patch
@@ -0,0 +1,86 @@
+From e54e50a1f35b5636d92baef536d78fd844267ca2 Mon Sep 17 00:00:00 2001
+From: Ronny Lorenz <ronny@tbi.univie.ac.at>
+Date: Tue, 28 Jan 2014 16:57:04 +0100
+Subject: [PATCH 5/8] remove all the remaining unnecessary stuff
+
+---
+ Node.cpp | 7 ++++---
+ Util.cpp | 27 +--------------------------
+ 2 files changed, 5 insertions(+), 29 deletions(-)
+
+diff --git a/Node.cpp b/Node.cpp
+index 3ddcb0f..3f33123 100644
+--- a/Node.cpp
++++ b/Node.cpp
+@@ -291,12 +291,13 @@ void Node::CalculateFoldingPath(Node* extremum,std::string integrated_structure)
+ int maxE_idx = -1;
+ int t = Node::transcribed;
+ std::vector<std::pair<double,std::string> > v;
+-
++ /* length of path always is the base pair distance + 1 */
++ p_len = bp_distance(const_cast<char*>(sequence.substr(0,t).c_str()),
++ const_cast<char*>(Node::front_structure.c_str())) + 1;
+ p = get_path(const_cast<char*>(sequence.substr(0,t).c_str()),
+ const_cast<char*>(Node::front_structure.c_str()),
+ const_cast<char*>(integrated_structure.substr(0,t).c_str()),
+- Node::OptS->maxkeep,
+- &p_len);
++ Node::OptS->maxkeep);
+ bool barrier_exceeded=false;
+ for (int i=0; i<p_len; i++) {
+ // memorize idx of structure with highest energy seen so far
+diff --git a/Util.cpp b/Util.cpp
+index d0a9ecb..592a303 100644
+--- a/Util.cpp
++++ b/Util.cpp
+@@ -57,16 +57,6 @@ std::string PrintPairTable(){
+ return s;
+ }
+
+-void
+-PrettyPrint(char *fmt, ...)
+-{
+- va_list args;
+-
+- va_start(args, fmt);
+- vfprintf(stdout, fmt, args);
+- fflush(stdout);
+- va_end(args);
+-}
+
+ std::string PrintBasePair(std::pair<int,int> bp){
+ return "("+Str(bp.first)+","+Str(bp.second)+")";
+@@ -283,21 +273,6 @@ ConformationToStacks(std::vector<std::vector<std::pair<int,int> > > & stacks, st
+ }
+ }
+
+-void *MG_space(unsigned size) {
+- void *pointer;
+-
+- if ( (pointer = (void *) calloc(1, (size_t) size)) == NULL) {
+-#ifdef EINVAL
+- if (errno==EINVAL) {
+- fprintf(stderr,"SPACE: requested size: %d\n", size);
+- printf("SPACE allocation failure -> EINVAL");
+- }
+- if (errno==ENOMEM)
+-#endif
+- printf("SPACE allocation failure -> no memory");
+- }
+- return pointer;
+-}
+
+ #ifdef WITH_DMALLOC
+ #define MG_space(S) calloc(1,(S))
+@@ -314,7 +289,7 @@ void *MG_space(unsigned size) {
+ // short *table;
+
+ length = (short) strlen(structure);
+- stack = (short *) MG_space(sizeof(short)*(length+1));
++ stack = (short *) space(sizeof(short)*(length+1));
+ //table = (short *) space(sizeof(short)*(length+2));
+ pair_table[0] = length;
+
+--
+2.5.2
+