فهرست منبع

lost: clang format

(cherry picked from commit 4a9bb81a69fbef11d92d294fa1db0711ff8e78db)
Daniel-Constantin Mierla 9 ماه پیش
والد
کامیت
6f78cc028b
4فایلهای تغییر یافته به همراه31 افزوده شده و 29 حذف شده
  1. 4 4
      src/modules/lost/functions.c
  2. 11 11
      src/modules/lost/response.c
  3. 15 13
      src/modules/lost/utilities.c
  4. 1 1
      src/modules/lost/utilities.h

+ 4 - 4
src/modules/lost/functions.c

@@ -382,8 +382,8 @@ int lost_held_function(struct sip_msg *_m, char *_con, char *_pidf, char *_url,
 	if(doc == NULL) {
 		LM_WARN("invalid xml document: [%.*s]\n", res.len, res.s);
 		doc = xmlReadMemory(res.s, res.len, 0, NULL,
-				XML_PARSE_NOBLANKS | XML_PARSE_NONET |
-				XML_PARSE_NOCDATA | XML_PARSE_RECOVER);
+				XML_PARSE_NOBLANKS | XML_PARSE_NONET | XML_PARSE_NOCDATA
+						| XML_PARSE_RECOVER);
 		if(doc == NULL) {
 			LM_ERR("xml document recovery failed on: [%.*s]\n", res.len, res.s);
 			goto err;
@@ -705,8 +705,8 @@ int lost_held_dereference(struct sip_msg *_m, char *_url, char *_pidf,
 	if(doc == NULL) {
 		LM_WARN("invalid xml document: [%.*s]\n", res.len, res.s);
 		doc = xmlReadMemory(res.s, res.len, 0, NULL,
-				XML_PARSE_NOBLANKS | XML_PARSE_NONET |
-				XML_PARSE_NOCDATA | XML_PARSE_RECOVER);
+				XML_PARSE_NOBLANKS | XML_PARSE_NONET | XML_PARSE_NOCDATA
+						| XML_PARSE_RECOVER);
 		if(doc == NULL) {
 			LM_ERR("xml document recovery failed on: [%.*s]\n", res.len, res.s);
 			goto err;

+ 11 - 11
src/modules/lost/response.c

@@ -54,7 +54,7 @@
 #include "utilities.h"
 #include "response.h"
 
-/* 
+/*
  * is_http_laquot(search)
  * return 1 if true else 0
  */
@@ -77,7 +77,7 @@ int is_http_laquot(char *search)
 	return 0;
 }
 
-/* 
+/*
  * is_https_laquot(search)
  * return 1 if true else 0
  */
@@ -101,7 +101,7 @@ int is_https_laquot(char *search)
 	return 0;
 }
 
-/* 
+/*
  * is_http(search)
  * return 1 if true else 0
  */
@@ -123,7 +123,7 @@ int is_http(char *search)
 	return 0;
 }
 
-/* 
+/*
  * is_https(search)
  * return 1 if true else 0
  */
@@ -146,7 +146,7 @@ int is_https(char *search)
 	return 0;
 }
 
-/* 
+/*
  * is_cid_laquot(search)
  * return 1 if true else 0
  */
@@ -168,7 +168,7 @@ int is_cid_laquot(char *search)
 	return 0;
 }
 
-/* 
+/*
  * is_cid(search)
  * return 1 if true else 0
  */
@@ -189,7 +189,7 @@ int is_cid(char *search)
 	return 0;
 }
 
-/* 
+/*
  * is_urn(search)
  * return 1 if true else 0
  */
@@ -612,7 +612,7 @@ void lost_free_findServiceResponse(p_lost_fsr_t *res)
 
 /*
  * lost_get_response_issue(node)
- * parses response issue (errors, warnings) and writes 
+ * parses response issue (errors, warnings) and writes
  * results to issue object
  */
 p_lost_issue_t lost_get_response_issues(xmlNodePtr node)
@@ -964,8 +964,8 @@ p_lost_fsr_t lost_parse_findServiceResponse(str ret)
 	if(doc == NULL) {
 		LM_ERR("invalid xml document: [%.*s]\n", ret.len, ret.s);
 		doc = xmlReadMemory(ret.s, ret.len, 0, NULL,
-				XML_PARSE_NOBLANKS | XML_PARSE_NONET |
-				XML_PARSE_NOCDATA | XML_PARSE_RECOVER);
+				XML_PARSE_NOBLANKS | XML_PARSE_NONET | XML_PARSE_NOCDATA
+						| XML_PARSE_RECOVER);
 		if(doc == NULL) {
 			LM_ERR("xml document recovery failed on: [%.*s]\n", ret.len, ret.s);
 			return NULL;
@@ -1095,4 +1095,4 @@ int lost_check_HeldResponse(xmlNodePtr node)
 	xmlFree(tmp); /* clean up */
 
 	return ret;
-}
+}

+ 15 - 13
src/modules/lost/utilities.c

@@ -906,9 +906,9 @@ p_lost_loc_t lost_parse_pidf(str pidf, str urn)
 
 	if(doc == NULL) {
 		LM_WARN("invalid xml (pidf-lo): [%.*s]\n", pidf.len, pidf.s);
-	doc = xmlReadMemory(pidf.s, pidf.len, 0, NULL,
-			XML_PARSE_NOBLANKS | XML_PARSE_NONET |
-			XML_PARSE_NOCDATA | XML_PARSE_RECOVER);
+		doc = xmlReadMemory(pidf.s, pidf.len, 0, NULL,
+				XML_PARSE_NOBLANKS | XML_PARSE_NONET | XML_PARSE_NOCDATA
+						| XML_PARSE_RECOVER);
 		if(doc == NULL) {
 			LM_ERR("xml (pidf-lo) recovery failed on: [%.*s]\n", pidf.len,
 					pidf.s);
@@ -1007,7 +1007,7 @@ int lost_check_3d(xmlNodePtr node)
 
 /*
  * lost_parse_geo(node, loc)
- * parses locationResponse (pos|circle) and writes 
+ * parses locationResponse (pos|circle) and writes
  * results to location object
  */
 int lost_parse_geo(xmlNodePtr node, p_lost_loc_t loc)
@@ -1070,7 +1070,7 @@ int lost_parse_geo(xmlNodePtr node, p_lost_loc_t loc)
 			pkg_free(loc->longitude);
 			goto err;
 		}
-		
+
 		snprintf(loc->altitude, len + 1, "%s", (char *)bufAlt);
 	}
 
@@ -1089,9 +1089,11 @@ int lost_parse_geo(xmlNodePtr node, p_lost_loc_t loc)
 	}
 	if((scan == 3) && (lost_geoloc_3d == 1)) {
 		s_profile = LOST_PRO_GEO3D;
-		snprintf(loc->geodetic, len + 1, "%s %s %s", (char *)bufLat, (char *)bufLon, (char *)bufAlt);
+		snprintf(loc->geodetic, len + 1, "%s %s %s", (char *)bufLat,
+				(char *)bufLon, (char *)bufAlt);
 	} else {
-		snprintf(loc->geodetic, len + 1, "%s %s", (char *)bufLat, (char *)bufLon);
+		snprintf(loc->geodetic, len + 1, "%s %s", (char *)bufLat,
+				(char *)bufLon);
 	}
 
 	/* find <radius> element */
@@ -1115,7 +1117,7 @@ err:
 
 /*
  * lost_xpath_location(doc, path, loc)
- * performs xpath expression on locationResponse and writes 
+ * performs xpath expression on locationResponse and writes
  * results (location-info child element) to location object
  */
 int lost_xpath_location(xmlDocPtr doc, char *path, p_lost_loc_t loc)
@@ -1185,7 +1187,7 @@ int lost_xpath_location(xmlDocPtr doc, char *path, p_lost_loc_t loc)
 						cname = BAD_CAST cur->name;
 						if(xmlStrcasecmp(cname, s_point) == 0) {
 							if((lost_check_3d(cur) == 1)
-								&& (lost_geoloc_3d == 1)) {
+									&& (lost_geoloc_3d == 1)) {
 								s_profile = LOST_PRO_GEO3D;
 								selgeo = i;
 								break;
@@ -1202,15 +1204,15 @@ int lost_xpath_location(xmlDocPtr doc, char *path, p_lost_loc_t loc)
 							break;
 						}
 						if((xmlStrcasecmp(cname, s_polygon) == 0)
-							|| (xmlStrcasecmp(cname, s_ellipse) == 0)
-							|| (xmlStrcasecmp(cname, s_arcband) == 0)) {
+								|| (xmlStrcasecmp(cname, s_ellipse) == 0)
+								|| (xmlStrcasecmp(cname, s_arcband) == 0)) {
 							s_profile = LOST_PRO_GEO2D;
 							selgeo = i;
 							break;
 						}
 						if((xmlStrcasecmp(cname, s_sphere) == 0)
-							|| (xmlStrcasecmp(cname, s_ellipsoid) == 0)
-							|| (xmlStrcasecmp(cname, s_prism) == 0)) {
+								|| (xmlStrcasecmp(cname, s_ellipsoid) == 0)
+								|| (xmlStrcasecmp(cname, s_prism) == 0)) {
 							if(lost_geoloc_3d == 1) {
 								s_profile = LOST_PRO_GEO3D;
 								selgeo = i;

+ 1 - 1
src/modules/lost/utilities.h

@@ -97,7 +97,7 @@ typedef struct lost_loc
 	char *geodetic;	 /* geodetic location (findServiceRequest) */
 	char *longitude; /* geo longitude */
 	char *latitude;	 /* geo latitude */
-	char *altitude;  /* geo altitude */
+	char *altitude;	 /* geo altitude */
 	char *profile;	 /* location profile (findServiceRequest) */
 	int radius;		 /* geo radius (findServiceRequest) */
 	int recursive;	 /* recursion true|false (findServiceRequest)*/