Skip to content

Commit

Permalink
fix char * warning 5
Browse files Browse the repository at this point in the history
  • Loading branch information
abratchik committed Dec 21, 2022
1 parent 99b6a01 commit 0cb0aa3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Docs/html/app__conn_8h_source.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keywordtype">int</span> getSSIDIndex();</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keywordtype">void</span> calcURLs();</div>
<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>
<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>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> </div>
<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>
<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>
Expand Down
16 changes: 8 additions & 8 deletions src/app_conn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,11 @@ int CLAppConn::loadPrefs() {

// read static IP
if(ret == OS_SUCCESS && json_obj_get_object(&jctx, (char*)"static_ip") == OS_SUCCESS) {
readStaticIPfromJSON(&jctx, &staticIP.ip, "ip");
readStaticIPfromJSON(&jctx, &staticIP.netmask, "netmask");
readStaticIPfromJSON(&jctx, &staticIP.gateway, "gateway");
readStaticIPfromJSON(&jctx, &staticIP.dns1, "dns1");
readStaticIPfromJSON(&jctx, &staticIP.dns2, "dns2");
readIPFromJSON(&jctx, &staticIP.ip, (char*)"ip");
readIPFromJSON(&jctx, &staticIP.netmask, (char*)"netmask");
readIPFromJSON(&jctx, &staticIP.gateway, (char*)"gateway");
readIPFromJSON(&jctx, &staticIP.dns1, (char*)"dns1");
readIPFromJSON(&jctx, &staticIP.dns2, (char*)"dns2");
json_obj_leave_object(&jctx);
}

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

// read AP IP
if(ret == OS_SUCCESS && json_obj_get_object(&jctx, (char*)"ap_ip") == OS_SUCCESS) {
readStaticIPfromJSON(&jctx, &apIP.ip, "ip");
readStaticIPfromJSON(&jctx, &apIP.netmask, "netmask");
readIPFromJSON(&jctx, &apIP.ip, (char*)"ip");
readIPFromJSON(&jctx, &apIP.netmask, (char*)"netmask");
json_obj_leave_object(&jctx);
}

Expand Down Expand Up @@ -277,7 +277,7 @@ void CLAppConn::setStaticIP (IPAddress ** ip_address, const char * strval) {
}
}

void CLAppConn::readStaticIPfromJSON (jparse_ctx_t * context, IPAddress ** ip_address, char * token) {
void CLAppConn::readIPFromJSON (jparse_ctx_t * context, IPAddress ** ip_address, char * token) {
char buf[16];
if(json_obj_get_string(context, token, buf, sizeof(buf)) == OS_SUCCESS) {
setStaticIP(ip_address, buf);
Expand Down
2 changes: 1 addition & 1 deletion src/app_conn.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class CLAppConn : public CLAppComponent {
private:
int getSSIDIndex();
void calcURLs();
void readStaticIPfromJSON(jparse_ctx_t * context, IPAddress ** ip_address, char * token);
void readIPFromJSON(jparse_ctx_t * context, IPAddress ** ip_address, char * token);

// Known networks structure. Max number of known stations limited for memory considerations
Station *stationList[MAX_KNOWN_STATIONS];
Expand Down
10 changes: 5 additions & 5 deletions src/app_httpd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,13 +540,13 @@ int CLAppHttpd::loadPrefs() {
return ret;
}

if (json_obj_get_array(&jctx, "mapping", &mappingCount) == OS_SUCCESS) {
if (json_obj_get_array(&jctx, (char*)"mapping", &mappingCount) == OS_SUCCESS) {
if(mappingCount > 0)
for(int i=0; i < mappingCount && i < MAX_URI_MAPPINGS; i++) {
if(json_arr_get_object(&jctx, i) == OS_SUCCESS) {
UriMapping *um = (UriMapping*) malloc(sizeof(UriMapping));
if(json_obj_get_string(&jctx, "uri", um->uri, sizeof(um->uri)) == OS_SUCCESS &&
json_obj_get_string(&jctx, "path", um->path, sizeof(um->path)) == OS_SUCCESS ) {
if(json_obj_get_string(&jctx, (char*)"uri", um->uri, sizeof(um->uri)) == OS_SUCCESS &&
json_obj_get_string(&jctx, (char*)"path", um->path, sizeof(um->path)) == OS_SUCCESS ) {
mappingList[i] = um;
}
else {
Expand All @@ -558,9 +558,9 @@ int CLAppHttpd::loadPrefs() {
json_obj_leave_array(&jctx);
}

json_obj_get_string(&jctx, "my_name", myName, sizeof(myName));
json_obj_get_string(&jctx, (char*)"my_name", myName, sizeof(myName));
bool dbg;
if(json_obj_get_bool(&jctx, "debug_mode", &dbg) == OS_SUCCESS)
if(json_obj_get_bool(&jctx, (char*)"debug_mode", &dbg) == OS_SUCCESS)
setDebugMode(dbg);

return ret;
Expand Down

0 comments on commit 0cb0aa3

Please sign in to comment.