Pārlūkot izejas kodu

utils/pdbt: removed trailing spaces

Daniel-Constantin Mierla 1 gadu atpakaļ
vecāks
revīzija
892c21deb2

+ 5 - 5
utils/pdbt/carrier.c

@@ -13,8 +13,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
@@ -78,21 +78,21 @@ int load_carrier_names(char *filename) {
 		idstr[2] = p[3];
 		p+=5;
 		len-=5;
-		
+
 		id = strtol(idstr, NULL, 10);
 		if (!IS_VALID_PDB_CARRIERID(id)) {
 			LWARNING("invalid carrier id '%s'\n", idstr);
 			ret=-1;
 			goto nextline;
 		}
-		
+
 		cnames[id]=malloc(len+1);
 		if (cnames[id]==NULL) {
 			LERR("out of memory (needed %ld bytes)\n", (long int)len);
 			ret=-1;
 			exit(-1);
 		}
-		
+
 		strncpy(cnames[id], p, len - 1);
 		cnames[id][len - 1]=0;
 

+ 2 - 2
utils/pdbt/carrier.h

@@ -13,8 +13,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 

+ 3 - 3
utils/pdbt/common.h

@@ -13,8 +13,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
@@ -24,7 +24,7 @@
 
 
 
-#include <stdint.h> 
+#include <stdint.h>
 
 
 

+ 7 - 7
utils/pdbt/dt.c

@@ -13,8 +13,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
@@ -267,21 +267,21 @@ int dt_optimize_leaf(struct dt_node_t *root, carrier_t lastcarrier)
 	if (node->carrier>0) currentcarrier=node->carrier;  /* new common carrier id starts at this node */
 	else currentcarrier=lastcarrier;		    /* carry over common carrier id */
 
-	/* 
-	 Nodes with children sharing the same carrier may be generalized into a common node (prefix). 
+	/*
+	 Nodes with children sharing the same carrier may be generalized into a common node (prefix).
 	 Note that the code in the following if-statement is the reason why dt_optimize() calls this function
 	 multiple times.
 	 */
 	if ((allcce=dt_allcce(node))) {
 		/*
 		 generalization requires having an intermediary parent node or a common carrier id between
-		 all children and the current node 
+		 all children and the current node
 		 */
 		if ((node->carrier == 0) || (node->carrier < 0 && allcce == currentcarrier)) {
 			currentcarrier=allcce;
 			node->carrier=currentcarrier;
 			for(i=0; i<10; i++) {
-				/* 
+				/*
 				 Negative carrier ids mark children eligible for generalization into a parent
 				 node. Carrier id 0 cannot be used because it could ambiguously refer to an
 				 intermediary parent node, thereby rendering differentiation of such nodes and
@@ -341,7 +341,7 @@ void dt_optimize(struct dt_node_t *root)
 {
 	int size;
 	int oldsize = 0;
-	
+
 	size=dt_size(root);
 
 	/*

+ 3 - 3
utils/pdbt/dt.h

@@ -13,8 +13,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
@@ -24,7 +24,7 @@
 
 
 
-#include "common.h" 
+#include "common.h"
 
 
 

+ 2 - 2
utils/pdbt/dtm.c

@@ -13,8 +13,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 

+ 2 - 2
utils/pdbt/dtm.h

@@ -13,8 +13,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 

+ 2 - 2
utils/pdbt/log.c

@@ -13,8 +13,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 

+ 2 - 2
utils/pdbt/log.h

@@ -13,8 +13,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 

+ 7 - 7
utils/pdbt/pdb_server.c

@@ -13,8 +13,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
@@ -212,7 +212,7 @@ int main(int argc, char *argv[]) {
 
 	int so;
 	struct sockaddr_in sa;
-		
+
 	while ((opt = getopt(argc, argv, "m:i:p:vhdl:")) != -1) {
 		switch (opt) {
 		case 'm':
@@ -272,13 +272,13 @@ int main(int argc, char *argv[]) {
 		LERR("cannot initialize backend.\n");
 		return -1;
 	}
-	
+
 	so = socket(AF_INET, SOCK_DGRAM, 0);
 	if (so<0) {
 		LERR("socket() failed with errno=%d (%s)\n", errno, strerror(errno));
 		return -1;
 	}
-	
+
 	memset(&sa, 0, sizeof(sa));
 	sa.sin_family = AF_INET;
 	sa.sin_port = htons(bind_port);
@@ -287,13 +287,13 @@ int main(int argc, char *argv[]) {
 		close(so);
 		return -1;
 	}
-	
+
 	if (bind(so, (struct sockaddr *) &sa, sizeof(sa))<0) {
 		LERR("bind() failed with errno=%d (%s)\n", errno, strerror(errno));
 		close(so);
 		return -1;
 	}
-	
+
 	udp_server(so);
 	close(so);
 

+ 2 - 2
utils/pdbt/pdb_server_backend.c

@@ -13,8 +13,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 

+ 2 - 2
utils/pdbt/pdb_server_backend.h

@@ -13,8 +13,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 

+ 18 - 18
utils/pdbt/pdbt.c

@@ -13,8 +13,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
@@ -182,7 +182,7 @@ int import_csv(struct dt_node_t *root, char *filename) {
 		carrier_str=line;
 		prefix=strsep(&carrier_str, ";");
 		if ( carrier_str == NULL ) {
-			LWARNING("line %ld: no delimiter `;' found, ignoring line.\n", n); 
+			LWARNING("line %ld: no delimiter `;' found, ignoring line.\n", n);
 			n++;
 			continue;
 		}
@@ -243,9 +243,9 @@ int dt_write_tree_recursor(const struct dt_node_t *node, const int fd, char* num
 
 	slen = strlen(number);
 	if (slen > 0) {
-		
+
 		bufsize = slen + 1 + 1 + 3 + 1 + 1;		    // line buffer (telephone number + colon + white space + carrier ID + newline + \0)
-		buf = (char *)malloc(bufsize);	    
+		buf = (char *)malloc(bufsize);
 		if (buf == NULL) {
 			LERR("could not allocate line output buffer of size %d\n", bufsize);
 			return -1;
@@ -302,7 +302,7 @@ int dt_write_tree(const struct dt_node_t *root, const char* filename)
 		LERR("cannot create file '%s'\n", filename);
 		return -1;
 	}
-	
+
 	if (dt_write_tree_recursor(root, fd, (char *)&number) < 0) {
 		LERR("writing tree to file '%s' failed\n", filename);
 		return -1;
@@ -484,7 +484,7 @@ int query_udp(char *number, int timeout, struct pollfd *pfds, struct sockaddr_in
 			return -PDB_TIMEOUT;
 		}
 	}
-	
+
 	/* prepare request */
 	reqlen = strlen(number) + 1; /* include null termination */
 	if (reqlen > sizeof(struct pdb_bdy)) {
@@ -631,16 +631,16 @@ int query_server(char *number, char *comment, void *data) {
 	if (carrierid<=0) {
 		LINFO("%s: not_found: comment='%s', result=%d\n", number, comment, carrierid);
 		if (carrierid < 0) {
-			result = carrierid; 
+			result = carrierid;
 		} else {
-			result = PDB_NOT_IN_PDB; 
+			result = PDB_NOT_IN_PDB;
 		}
 	}
 	else {
 		LINFO("%s:%ld:%s\n", number, (long int)carrierid, carrierid2name(carrierid));
 		result = PDB_OK;
 	}
-	return result; 
+	return result;
 }
 
 
@@ -871,18 +871,18 @@ int main(int argc, char *argv[]) {
 					exit_status = PDB_USE_ERROR;
 				}
 				for (n=optind+1; n<argc; n++) {
-					int result; 
-					result = query_server(argv[n], "", &sdata); 
+					int result;
+					result = query_server(argv[n], "", &sdata);
 					if ( result != 0) {
-						exit_status = -result; 
+						exit_status = -result;
 					}
 				}
 			}
 			else {
-				int result; 
+				int result;
 				result = file_query(query_file, query_server, &sdata);
 				if ( result != 0) {
-					exit_status = -result; 
+					exit_status = -result;
 				}
 			}
 		}
@@ -892,7 +892,7 @@ int main(int argc, char *argv[]) {
 				LERR("cannot load '%s'.\n", mmap_file);
 				exit(PDB_USE_ERROR);
 			}
-			
+
 			if (query_file==NULL) {
 				LINFO("\nprocessing command line parameters...\n");
 				for (n=optind+1; n<argc; n++) {
@@ -900,10 +900,10 @@ int main(int argc, char *argv[]) {
 				}
 			}
 			else {
-				int result; 
+				int result;
 				result = file_query(query_file, query_mmap, mroot);
 				if ( result != 0) {
-					exit_status = -result; 
+					exit_status = -result;
 				}
 			}
 		}