Skip to content

Commit 0cb0aa3

Browse files
committed
fix char * warning 5
1 parent 99b6a01 commit 0cb0aa3

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

Docs/html/app__conn_8h_source.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="keyword">private</span>:</div>
160160
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keywordtype">int</span> getSSIDIndex();</div>
161161
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keywordtype">void</span> calcURLs();</div>
162-
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keywordtype">void</span> readStaticIPfromJSON(jparse_ctx_t * context, IPAddress ** ip_address, <span class="keywordtype">char</span> * token);</div>
162+
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keywordtype">void</span> readIPFromJSON(jparse_ctx_t * context, IPAddress ** ip_address, <span class="keywordtype">char</span> * token);</div>
163163
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> </div>
164164
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="comment">// Known networks structure. Max number of known stations limited for memory considerations</span></div>
165165
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <a class="code hl_struct" href="struct_station.html">Station</a> *stationList[<a class="code hl_define" href="app__conn_8h.html#a83592674d0318a8edd98e994f0fed16b">MAX_KNOWN_STATIONS</a>]; </div>

src/app_conn.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,11 @@ int CLAppConn::loadPrefs() {
227227

228228
// read static IP
229229
if(ret == OS_SUCCESS && json_obj_get_object(&jctx, (char*)"static_ip") == OS_SUCCESS) {
230-
readStaticIPfromJSON(&jctx, &staticIP.ip, "ip");
231-
readStaticIPfromJSON(&jctx, &staticIP.netmask, "netmask");
232-
readStaticIPfromJSON(&jctx, &staticIP.gateway, "gateway");
233-
readStaticIPfromJSON(&jctx, &staticIP.dns1, "dns1");
234-
readStaticIPfromJSON(&jctx, &staticIP.dns2, "dns2");
230+
readIPFromJSON(&jctx, &staticIP.ip, (char*)"ip");
231+
readIPFromJSON(&jctx, &staticIP.netmask, (char*)"netmask");
232+
readIPFromJSON(&jctx, &staticIP.gateway, (char*)"gateway");
233+
readIPFromJSON(&jctx, &staticIP.dns1, (char*)"dns1");
234+
readIPFromJSON(&jctx, &staticIP.dns2, (char*)"dns2");
235235
json_obj_leave_object(&jctx);
236236
}
237237

@@ -244,8 +244,8 @@ int CLAppConn::loadPrefs() {
244244

245245
// read AP IP
246246
if(ret == OS_SUCCESS && json_obj_get_object(&jctx, (char*)"ap_ip") == OS_SUCCESS) {
247-
readStaticIPfromJSON(&jctx, &apIP.ip, "ip");
248-
readStaticIPfromJSON(&jctx, &apIP.netmask, "netmask");
247+
readIPFromJSON(&jctx, &apIP.ip, (char*)"ip");
248+
readIPFromJSON(&jctx, &apIP.netmask, (char*)"netmask");
249249
json_obj_leave_object(&jctx);
250250
}
251251

@@ -277,7 +277,7 @@ void CLAppConn::setStaticIP (IPAddress ** ip_address, const char * strval) {
277277
}
278278
}
279279

280-
void CLAppConn::readStaticIPfromJSON (jparse_ctx_t * context, IPAddress ** ip_address, char * token) {
280+
void CLAppConn::readIPFromJSON (jparse_ctx_t * context, IPAddress ** ip_address, char * token) {
281281
char buf[16];
282282
if(json_obj_get_string(context, token, buf, sizeof(buf)) == OS_SUCCESS) {
283283
setStaticIP(ip_address, buf);

src/app_conn.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class CLAppConn : public CLAppComponent {
9999
private:
100100
int getSSIDIndex();
101101
void calcURLs();
102-
void readStaticIPfromJSON(jparse_ctx_t * context, IPAddress ** ip_address, char * token);
102+
void readIPFromJSON(jparse_ctx_t * context, IPAddress ** ip_address, char * token);
103103

104104
// Known networks structure. Max number of known stations limited for memory considerations
105105
Station *stationList[MAX_KNOWN_STATIONS];

src/app_httpd.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -540,13 +540,13 @@ int CLAppHttpd::loadPrefs() {
540540
return ret;
541541
}
542542

543-
if (json_obj_get_array(&jctx, "mapping", &mappingCount) == OS_SUCCESS) {
543+
if (json_obj_get_array(&jctx, (char*)"mapping", &mappingCount) == OS_SUCCESS) {
544544
if(mappingCount > 0)
545545
for(int i=0; i < mappingCount && i < MAX_URI_MAPPINGS; i++) {
546546
if(json_arr_get_object(&jctx, i) == OS_SUCCESS) {
547547
UriMapping *um = (UriMapping*) malloc(sizeof(UriMapping));
548-
if(json_obj_get_string(&jctx, "uri", um->uri, sizeof(um->uri)) == OS_SUCCESS &&
549-
json_obj_get_string(&jctx, "path", um->path, sizeof(um->path)) == OS_SUCCESS ) {
548+
if(json_obj_get_string(&jctx, (char*)"uri", um->uri, sizeof(um->uri)) == OS_SUCCESS &&
549+
json_obj_get_string(&jctx, (char*)"path", um->path, sizeof(um->path)) == OS_SUCCESS ) {
550550
mappingList[i] = um;
551551
}
552552
else {
@@ -558,9 +558,9 @@ int CLAppHttpd::loadPrefs() {
558558
json_obj_leave_array(&jctx);
559559
}
560560

561-
json_obj_get_string(&jctx, "my_name", myName, sizeof(myName));
561+
json_obj_get_string(&jctx, (char*)"my_name", myName, sizeof(myName));
562562
bool dbg;
563-
if(json_obj_get_bool(&jctx, "debug_mode", &dbg) == OS_SUCCESS)
563+
if(json_obj_get_bool(&jctx, (char*)"debug_mode", &dbg) == OS_SUCCESS)
564564
setDebugMode(dbg);
565565

566566
return ret;

0 commit comments

Comments
 (0)