diff options
author | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2018-09-19 11:18:29 +0200 |
---|---|---|
committer | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2018-10-08 15:57:27 +0200 |
commit | daff7a6ee4900e54dee42f5528a32ef50bd5bcab (patch) | |
tree | 88e042d277f255807d7e01dd9eee6f80d75cc6cf /4a-hal/4a-hal-controllers | |
parent | 5e00458411e8bbfa146c0f6c256d740830cc0396 (diff) |
Remove unnecessary 'function' string in prints
Function's names was printed using '__func__' when calling application
framework prints functions.
But, as the application framework prints functions already prints
them, '__func__' has been removed from print calls to avoid
duplicated information.
Change-Id: I0dea49a9d84b7ccdbdaecec67ced6c98b5ed26d6
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to '4a-hal/4a-hal-controllers')
5 files changed, 78 insertions, 102 deletions
diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.c b/4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.c index 096c82f..e08958c 100644 --- a/4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.c +++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.c @@ -105,12 +105,12 @@ int HalCtlsGetCardIdByCardPath(AFB_ApiT apiHandle, char *devPath) json_object *toSendJ, *returnJ = NULL, *responsJ, *devidJ; if(! apiHandle) { - AFB_ApiError(apiHandle, "%s: api handle not available", __func__); + AFB_ApiError(apiHandle, "Api handle not available"); return -1; } if(! devPath) { - AFB_ApiError(apiHandle, "%s: dev path is not available", __func__); + AFB_ApiError(apiHandle, "Dev path is not available"); return -2; } @@ -193,24 +193,23 @@ int HalCtlsGetAlsaCtlInfo(AFB_ApiT apiHandle, char *cardId, struct CtlHalAlsaCtl json_object *queryJ, *returnedJ = NULL; if(! apiHandle) { - AFB_ApiError(apiHandle, "%s: api handle not available", __func__); + AFB_ApiError(apiHandle, "Api handle not available"); return -1; } if(! cardId) { - AFB_ApiError(apiHandle, "%s: card id is not available", __func__); + AFB_ApiError(apiHandle, "Card id is not available"); return -2; } if(! currentAlsaCtl) { - AFB_ApiError(apiHandle, "%s: alsa control data structure is not available", __func__); + AFB_ApiError(apiHandle, "Alsa control data structure is not available"); return -3; } if(currentAlsaCtl->name && currentAlsaCtl->numid > 0) { AFB_ApiError(apiHandle, - "%s: Can't have both a control name (%s) and a control uid (%i)", - __func__, + "Can't have both a control name (%s) and a control uid (%i)", currentAlsaCtl->name, currentAlsaCtl->numid); return -4; @@ -222,7 +221,7 @@ int HalCtlsGetAlsaCtlInfo(AFB_ApiT apiHandle, char *cardId, struct CtlHalAlsaCtl wrap_json_pack(&queryJ, "{s:s s:i s:i}", "devid", cardId, "ctl", currentAlsaCtl->numid, "mode", 3); } else { - AFB_ApiError(apiHandle, "%s: Need at least a control name or a control uid", __func__); + AFB_ApiError(apiHandle, "Need at least a control name or a control uid"); return -5; } @@ -279,22 +278,22 @@ int HalCtlsSetAlsaCtlValue(AFB_ApiT apiHandle, char *cardId, int ctlId, json_obj json_object *queryJ, *returnedJ = NULL, *returnedWarningJ; if(! apiHandle) { - AFB_ApiError(apiHandle, "%s: api handle not available", __func__); + AFB_ApiError(apiHandle, "Api handle not available"); return -1; } if(! cardId) { - AFB_ApiError(apiHandle, "%s: card id is not available", __func__); + AFB_ApiError(apiHandle, "Card id is not available"); return -2; } if(ctlId <= 0) { - AFB_ApiError(apiHandle, "%s: Alsa control id is not valid", __func__); + AFB_ApiError(apiHandle, "Alsa control id is not valid"); return -3; } if(! valuesJ) { - AFB_ApiError(apiHandle, "%s: values to set json is not available", __func__); + AFB_ApiError(apiHandle, "Values to set json is not available"); return -4; } @@ -337,22 +336,22 @@ int HalCtlsCreateAlsaCtl(AFB_ApiT apiHandle, char *cardId, struct CtlHalAlsaCtl json_object *queryJ, *returnedJ = NULL, *returnedWarningJ, *responseJ; if(! apiHandle) { - AFB_ApiError(apiHandle, "%s: api handle not available", __func__); + AFB_ApiError(apiHandle, "Api handle not available"); return -1; } if(! cardId) { - AFB_ApiError(apiHandle, "%s: card id is not available", __func__); + AFB_ApiError(apiHandle, "Card id is not available"); return -2; } if(! alsaCtlToCreate) { - AFB_ApiError(apiHandle, "%s: alsa control data structure is not available", __func__); + AFB_ApiError(apiHandle, "Alsa control data structure is not available"); return -3; } if(! alsaCtlToCreate->alsaCtlCreation) { - AFB_ApiError(apiHandle, "%s: alsa control data for creation structure is not available", __func__); + AFB_ApiError(apiHandle, "Alsa control data for creation structure is not available"); return -4; } diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c b/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c index c6fc4d6..a5d9c7a 100644 --- a/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c +++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c @@ -115,7 +115,7 @@ static int HalCtlsInitOneApi(AFB_ApiT apiHandle) else { currentCtlHalData->status = HAL_STATUS_AVAILABLE; if((err = HalCtlsAttachToMixer(apiHandle))) { - AFB_ApiError(apiHandle, "%s: Error %i while attaching to mixer", __func__, err); + AFB_ApiError(apiHandle, "Error %i while attaching to mixer", err); return -4; } } @@ -140,7 +140,7 @@ static int HalCtlsLoadOneApi(void *cbdata, AFB_ApiT apiHandle) // Add static controls verbs if(HalUtlLoadVerbs(apiHandle, CtlHalDynApiStaticVerbs)) { - AFB_ApiError(apiHandle, "%s : load Section : fail to register static V2 verbs", __func__); + AFB_ApiError(apiHandle, "Load Section : fail to register static V2 verbs"); return 1; } @@ -168,12 +168,12 @@ int HalCtlsCreateApi(AFB_ApiT apiHandle, char *path, struct HalMgrData *HalMgrGl // Create one Api per file ctrlConfig = CtlLoadMetaData(apiHandle, path); if(! ctrlConfig) { - AFB_ApiError(apiHandle, "%s: No valid control config file in:\n-- %s", __func__, path); + AFB_ApiError(apiHandle, "No valid control config file in:\n-- %s", path); return -2; } if(! ctrlConfig->api) { - AFB_ApiError(apiHandle, "%s: API Missing from metadata in:\n-- %s", __func__, path); + AFB_ApiError(apiHandle, "API Missing from metadata in:\n-- %s", path); return -3; } @@ -213,7 +213,7 @@ int HalCtlsCreateAllApi(AFB_ApiT apiHandle, struct HalMgrData *HalMgrGlobalData) // Hugely hack to make all V2 AFB_DEBUG to work in fileutils AFB_default = apiHandle; - AFB_ApiNotice(apiHandle, "In %s", __func__); + AFB_ApiNotice(apiHandle, "Begining to create all APIs"); dirList = getenv("CONTROL_CONFIG_PATH"); if(! dirList) @@ -221,7 +221,7 @@ int HalCtlsCreateAllApi(AFB_ApiT apiHandle, struct HalMgrData *HalMgrGlobalData) configJ = CtlConfigScan(dirList, "hal"); if(! configJ) { - AFB_ApiWarning(apiHandle, "%s: No hal-(binder-middle-name)*.json config file(s) found in %s, 4a-hal-manager will only works with external hal", __func__, dirList); + AFB_ApiWarning(apiHandle, "No hal-(binder-middle-name)*.json config file(s) found in %s, 4a-hal-manager will only works with external hal", dirList); return 0; } @@ -230,7 +230,7 @@ int HalCtlsCreateAllApi(AFB_ApiT apiHandle, struct HalMgrData *HalMgrGlobalData) entryJ = json_object_array_get_idx(configJ, index); if(wrap_json_unpack(entryJ, "{s:s, s:s !}", "fullpath", &fullPath, "filename", &fileName)) { - AFB_ApiError(apiHandle, "%s: HOOPs invalid JSON entry = %s", __func__, json_object_get_string(entryJ)); + AFB_ApiError(apiHandle, "HOOPs invalid JSON entry = %s", json_object_get_string(entryJ)); return -2; } diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c b/4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c index 611c663..54d06e3 100644 --- a/4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c +++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c @@ -46,17 +46,17 @@ void HalCtlsDispatchApiEvent(afb_dynapi *apiHandle, const char *evtLabel, json_o json_object *valuesJ; - AFB_ApiDebug(apiHandle, "%s: evtname=%s [msg=%s]", __func__, evtLabel, json_object_get_string(eventJ)); + AFB_ApiDebug(apiHandle, "Evtname=%s [msg=%s]", evtLabel, json_object_get_string(eventJ)); ctrlConfig = (CtlConfigT *) afb_dynapi_get_userdata(apiHandle); if(! ctrlConfig) { - AFB_ApiError(apiHandle, "%s: Can't get current hal controller config", __func__); + AFB_ApiError(apiHandle, "Can't get current hal controller config"); return; } currentHalData = (struct SpecificHalData *) ctrlConfig->external; if(! currentHalData) { - AFB_ApiWarning(apiHandle, "%s: Can't get current hal controller data", __func__); + AFB_ApiWarning(apiHandle, "Can't get current hal controller data"); return; } @@ -68,7 +68,7 @@ void HalCtlsDispatchApiEvent(afb_dynapi *apiHandle, const char *evtLabel, json_o sscanf(&evtLabel[idx + 1], "%d", &cardidx) == 1 && currentHalData->sndCardId == cardidx) { if(wrap_json_unpack(eventJ, "{s:i s:o !}", "id", &numid, "val", &valuesJ)) { - AFB_ApiError(apiHandle, "%s: Invalid Alsa Event label=%s value=%s", __func__, evtLabel, json_object_get_string(eventJ)); + AFB_ApiError(apiHandle, "Invalid Alsa Event label=%s value=%s", evtLabel, json_object_get_string(eventJ)); return; } @@ -86,8 +86,7 @@ void HalCtlsDispatchApiEvent(afb_dynapi *apiHandle, const char *evtLabel, json_o } else { AFB_ApiNotice(apiHandle, - "%s: The alsa control id '%i' is corresponding to a known control but without any action registered", - __func__, + "The alsa control id '%i' is corresponding to a known control but without any action registered", numid); } @@ -95,8 +94,7 @@ void HalCtlsDispatchApiEvent(afb_dynapi *apiHandle, const char *evtLabel, json_o } } - AFB_ApiWarning(apiHandle, "%s: alsacore event with an unrecognized numid: %i, evtname=%s [msg=%s]", - __func__, + AFB_ApiWarning(apiHandle, "Alsacore event with an unrecognized numid: %i, evtname=%s [msg=%s]", numid, evtLabel, json_object_get_string(eventJ)); @@ -105,8 +103,7 @@ void HalCtlsDispatchApiEvent(afb_dynapi *apiHandle, const char *evtLabel, json_o } AFB_ApiInfo(apiHandle, - "%s: not an alsacore event '%s' [msg=%s]", - __func__, + "Not an alsacore event '%s' [msg=%s]", evtLabel, json_object_get_string(eventJ)); @@ -154,14 +151,14 @@ int HalCtlsProcessOneHalMapObject(AFB_ApiT apiHandle, struct CtlHalAlsaMap *alsa json_object *alsaJ = NULL, *createAlsaCtlJ = NULL; - AFB_ApiDebug(apiHandle, "%s: AlsaMapJ=%s", __func__, json_object_get_string(AlsaMapJ)); + AFB_ApiDebug(apiHandle, "AlsaMapJ=%s", json_object_get_string(AlsaMapJ)); if(wrap_json_unpack(AlsaMapJ, "{s:s s?:s s:o s?:s !}", "uid", &alsaMap->uid, "info", &alsaMap->info, "alsa", &alsaJ, "action", &action)) { - AFB_ApiError(apiHandle, "%s: parsing error, map should only contains [label]|[uid]|[tag]|[info]|[alsa]|[action] in:\n-- %s", __func__, json_object_get_string(AlsaMapJ)); + AFB_ApiError(apiHandle, "Parsing error, map should only contains [label]|[uid]|[tag]|[info]|[alsa]|[action] in:\n-- %s", json_object_get_string(AlsaMapJ)); return -1; } @@ -170,7 +167,7 @@ int HalCtlsProcessOneHalMapObject(AFB_ApiT apiHandle, struct CtlHalAlsaMap *alsa "numid", &alsaMap->ctl.numid, "value", &alsaMap->ctl.value, "create", &createAlsaCtlJ)) { - AFB_ApiError(apiHandle, "%s: parsing error, alsa json should only contains [name]|[numid]||[value]|[create] in:\n-- %s", __func__, json_object_get_string(alsaJ)); + AFB_ApiError(apiHandle, "Parsing error, alsa json should only contains [name]|[numid]||[value]|[create] in:\n-- %s", json_object_get_string(alsaJ)); return -2; } @@ -184,12 +181,12 @@ int HalCtlsProcessOneHalMapObject(AFB_ApiT apiHandle, struct CtlHalAlsaMap *alsa "minval", &alsaMap->ctl.alsaCtlCreation->minval, "maxval", &alsaMap->ctl.alsaCtlCreation->maxval, "step", &alsaMap->ctl.alsaCtlCreation->step)) { - AFB_ApiError(apiHandle, "%s: parsing error, alsa creation json should only contains [type]|[count]|[minval]|[maxval]|[step] in:\n-- %s", __func__, json_object_get_string(alsaJ)); + AFB_ApiError(apiHandle, "Parsing error, alsa creation json should only contains [type]|[count]|[minval]|[maxval]|[step] in:\n-- %s", json_object_get_string(alsaJ)); return -3; } if(typename && (alsaMap->ctl.alsaCtlCreation->type = HalCtlsMapsAlsaTypeToEnum(typename)) == SND_CTL_ELEM_TYPE_NONE) { - AFB_ApiError(apiHandle, "%s: Couldn't get alsa type from string %s in:\n-- %s", __func__, typename, json_object_get_string(alsaJ)); + AFB_ApiError(apiHandle, "Couldn't get alsa type from string %s in:\n-- %s", typename, json_object_get_string(alsaJ)); return -4; } @@ -198,8 +195,7 @@ int HalCtlsProcessOneHalMapObject(AFB_ApiT apiHandle, struct CtlHalAlsaMap *alsa } else if(alsaMap->ctl.name && alsaMap->ctl.numid > 0) { AFB_ApiError(apiHandle, - "%s: Can't have both a control name (%s) and a control uid (%i) in alsa object:\n-- %s", - __func__, + "Can't have both a control name (%s) and a control uid (%i) in alsa object:\n-- %s", alsaMap->ctl.name, alsaMap->ctl.numid, json_object_get_string(alsaJ)); @@ -207,8 +203,7 @@ int HalCtlsProcessOneHalMapObject(AFB_ApiT apiHandle, struct CtlHalAlsaMap *alsa } else if(! alsaMap->ctl.name && alsaMap->ctl.numid <= 0) { AFB_ApiError(apiHandle, - "%s: Need at least a control name or a control uid in alsa object:\n-- %s", - __func__, + "Need at least a control name or a control uid in alsa object:\n-- %s", json_object_get_string(alsaJ)); return -6; } @@ -227,16 +222,12 @@ int HalCtlsHandleOneHalMapObject(AFB_ApiT apiHandle, char *cardId, struct CtlHal if(alsaMap->ctl.alsaCtlCreation) { if(HalCtlsCreateAlsaCtl(apiHandle, cardId, &alsaMap->ctl)) { - AFB_ApiError(apiHandle, - "%s: An error happened when trying to create a new alsa control", - __func__); + AFB_ApiError(apiHandle, "An error happened when trying to create a new alsa control"); return -1; } } else if(HalCtlsGetAlsaCtlInfo(apiHandle, cardId, &alsaMap->ctl)) { - AFB_ApiError(apiHandle, - "%s: An error happened when trying to get existing alsa control info", - __func__); + AFB_ApiError(apiHandle, "An error happened when trying to get existing alsa control info"); return -2; } @@ -271,8 +262,7 @@ int HalCtlsHandleOneHalMapObject(AFB_ApiT apiHandle, char *cardId, struct CtlHal alsaMap->action = calloc(1, sizeof(CtlActionT)); if(ActionLoadOne(apiHandle, alsaMap->action, alsaMap->actionJ, 0)) { AFB_ApiError(apiHandle, - "%s: Didn't succeed to load action using alsa object:\n-- %s", - __func__, + "Didn't succeed to load action using alsa object:\n-- %s", json_object_get_string(alsaMap->actionJ)); return -5; } @@ -280,8 +270,7 @@ int HalCtlsHandleOneHalMapObject(AFB_ApiT apiHandle, char *cardId, struct CtlHal if(afb_dynapi_add_verb(apiHandle, alsaMap->uid, alsaMap->info, HalCtlsActionOnAlsaCtl, (void *) alsaMap, NULL, 0)) { AFB_ApiError(apiHandle, - "%s: Didn't to create verb for current alsa control to load action using alsa object:\n-- %s", - __func__, + "Didn't to create verb for current alsa control to load action using alsa object:\n-- %s", json_object_get_string(alsaMap->actionJ)); return -6; } @@ -310,7 +299,7 @@ int HalCtlsProcessAllHalMap(AFB_ApiT apiHandle, json_object *AlsaMapJ, struct Ct default: currentCtlHalAlsaMapT->ctlsCount = 0; currentCtlHalAlsaMapT->ctls = NULL; - AFB_ApiWarning(apiHandle, "%s: couldn't get content of 'halmap' section in:\n-- %s", __func__, json_object_get_string(AlsaMapJ)); + AFB_ApiWarning(apiHandle, "Couldn't get content of 'halmap' section in:\n-- %s", json_object_get_string(AlsaMapJ)); return -1; } @@ -357,28 +346,28 @@ int HalCtlsHalMapConfig(AFB_ApiT apiHandle, CtlSectionT *section, json_object *A currentHalData->ctlHalSpecificData->ctlHalAlsaMapT = calloc(1, sizeof(struct CtlHalAlsaMapT)); if(HalCtlsProcessAllHalMap(apiHandle, AlsaMapJ, currentHalData->ctlHalSpecificData->ctlHalAlsaMapT)) { - AFB_ApiError(apiHandle, "%s: failed to process 'halmap' section", __func__); + AFB_ApiError(apiHandle, "Failed to process 'halmap' section"); return -3; } } else if(currentHalData->status == HAL_STATUS_UNAVAILABLE) { - AFB_ApiWarning(apiHandle, "%s: hal is unavailable, 'halmap' section data can't be handle", __func__); + AFB_ApiWarning(apiHandle, "Hal is unavailable, 'halmap' section data can't be handle"); return 1; } else if(currentHalData->sndCardId < 0) { - AFB_ApiError(apiHandle, "%s: hal alsa card id is not valid, 'halmap' section data can't be handle", __func__); + AFB_ApiError(apiHandle, "Hal alsa card id is not valid, 'halmap' section data can't be handle"); return -6; } else if(! currentHalData->ctlHalSpecificData->ctlHalAlsaMapT) { - AFB_ApiWarning(apiHandle, "%s: 'halmap' section data is empty", __func__); + AFB_ApiWarning(apiHandle, "'halmap' section data is empty"); return 2; } else if(! (currentHalData->ctlHalSpecificData->ctlHalAlsaMapT->ctlsCount > 0)) { - AFB_ApiWarning(apiHandle, "%s: no alsa controls defined in 'halmap' section", __func__); + AFB_ApiWarning(apiHandle, "No alsa controls defined in 'halmap' section"); return 3; } else if(HalCtlsHandleAllHalMap(apiHandle, currentHalData->sndCardId, currentHalData->ctlHalSpecificData->ctlHalAlsaMapT)) { - AFB_ApiError(apiHandle, "%s: failed to handle 'halmap' section", __func__); + AFB_ApiError(apiHandle, "Failed to handle 'halmap' section"); return -9; } @@ -453,8 +442,7 @@ void HalCtlsActionOnCall(AFB_ReqT request) else if(wrap_json_unpack(returnJ, "{s:o}", "response", &toReturnJ)) { AFB_ReqSuccessF(request, json_object_get(returnJ), - "%s: Seems that %s call to api %s succeed, but no response was found : '%s'", - __func__, + "Seems that %s call to api %s succeed, but no response was found : '%s'", currentMixerData->verbToCall, apiToCall, json_object_get_string(returnJ)); @@ -544,7 +532,7 @@ void HalCtlsInfo(AFB_ReqT request) requestJson = AFB_ReqJson(request); if(! requestJson) { - AFB_ReqNotice(request, "%s: Can't get request json", __func__); + AFB_ReqNotice(request, "Can't get request json"); } else if(json_object_is_type(requestJson, json_type_object) && json_object_get_object(requestJson)->count > 0) { apiToCall = currentCtlHalData->ctlHalSpecificData->mixerApiName; diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-mixer-link.c b/4a-hal/4a-hal-controllers/4a-hal-controllers-mixer-link.c index 8658cc2..254c57b 100644 --- a/4a-hal/4a-hal-controllers/4a-hal-controllers-mixer-link.c +++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-mixer-link.c @@ -55,7 +55,7 @@ int HalCtlsHandleMixerData(AFB_ApiT apiHandle, struct CtlHalMixerDataT *currentM break; default: currentMixerDataT->count = 0; - AFB_ApiError(apiHandle, "%s: no data returned", __func__); + AFB_ApiError(apiHandle, "No data returned"); return (int) MIXER_ERROR_DATA_EMPTY; } @@ -68,11 +68,11 @@ int HalCtlsHandleMixerData(AFB_ApiT apiHandle, struct CtlHalMixerDataT *currentM currentJ = currentDataJ; if(wrap_json_unpack(currentJ, "{s:s}", "verb", ¤tDataVerbName)) { - AFB_ApiError(apiHandle, "%s: can't find verb in current data object", __func__); + AFB_ApiError(apiHandle, "Can't find verb in current data object"); err += (int) MIXER_ERROR_DATA_NAME_UNAVAILABLE; } else if(dataType == MIXER_DATA_STREAMS && wrap_json_unpack(currentJ, "{s:s}", "alsa", ¤tStreamCardId)) { - AFB_ApiError(apiHandle, "%s: can't find card id in current data object", __func__); + AFB_ApiError(apiHandle, "Can't find card id in current data object"); err += (int) MIXER_ERROR_DATA_CARDID_UNAVAILABLE; } else { @@ -102,8 +102,7 @@ int HalCtlsHandleMixerData(AFB_ApiT apiHandle, struct CtlHalMixerDataT *currentM NULL, 0)) { AFB_ApiError(apiHandle, - "%s: error while creating verbs for stream : '%s'", - __func__, + "Error while creating verbs for stream : '%s'", currentMixerDataT->data[idx].verb); err += (int) MIXER_ERROR_STREAM_VERB_NOT_CREATED; } @@ -125,7 +124,7 @@ int HalCtlsHandleMixerData(AFB_ApiT apiHandle, struct CtlHalMixerDataT *currentM (void *) currentMixerDataT->data, NULL, 0)) { - AFB_ApiError(apiHandle, "%s: error while creating verb for playbacks : '%s'", __func__, HAL_PLAYBACK_VERB); + AFB_ApiError(apiHandle, "Error while creating verb for playbacks : '%s'", HAL_PLAYBACK_VERB); err += (int) MIXER_ERROR_PLAYBACK_VERB_NOT_CREATED; } } @@ -138,7 +137,7 @@ int HalCtlsHandleMixerData(AFB_ApiT apiHandle, struct CtlHalMixerDataT *currentM (void *) currentMixerDataT->data, NULL, 0)) { - AFB_ApiError(apiHandle, "%s: error while creating verb for captures : '%s'", __func__, HAL_CAPTURE_VERB); + AFB_ApiError(apiHandle, "Error while creating verb for captures : '%s'", HAL_CAPTURE_VERB); err += (int) MIXER_ERROR_CAPTURE_VERB_NOT_CREATED; } } @@ -153,23 +152,23 @@ int HalCtlsHandleMixerAttachResponse(AFB_ApiT apiHandle, struct CtlHalSpecificDa json_object *mixerStreamsJ = NULL, *mixerPlaybacksJ = NULL, *mixerCapturesJ = NULL; if(! apiHandle) { - AFB_ApiError(apiHandle, "%s: Can't get current hal api handle", __func__); + AFB_ApiError(apiHandle, "Can't get current hal api handle"); return (int) MIXER_ERROR_API_UNAVAILABLE; } if(wrap_json_unpack(mixerResponseJ, "{s?:o s?:o s?:o}", "streams", &mixerStreamsJ, "playbacks", &mixerPlaybacksJ, "captures", &mixerCapturesJ)) { - AFB_ApiError(apiHandle, "%s: Can't get streams|playbacks|captures object in '%s'", __func__, json_object_get_string(mixerResponseJ)); + AFB_ApiError(apiHandle, "Can't get streams|playbacks|captures object in '%s'", json_object_get_string(mixerResponseJ)); return (int) MIXER_ERROR_DATA_UNAVAILABLE; } if(mixerStreamsJ && (err += HalCtlsHandleMixerData(apiHandle, ¤tHalSpecificData->ctlHalStreamsData, mixerStreamsJ, MIXER_DATA_STREAMS))) - AFB_ApiError(apiHandle, "%s: Error during handling response mixer streams data '%s'", __func__, json_object_get_string(mixerStreamsJ)); + AFB_ApiError(apiHandle, "Error during handling response mixer streams data '%s'", json_object_get_string(mixerStreamsJ)); if(mixerPlaybacksJ && (err += HalCtlsHandleMixerData(apiHandle, ¤tHalSpecificData->ctlHalPlaybacksData, mixerPlaybacksJ, MIXER_DATA_PLAYBACKS))) - AFB_ApiError(apiHandle, "%s: Error during handling response mixer playbacks data '%s'", __func__, json_object_get_string(mixerPlaybacksJ)); + AFB_ApiError(apiHandle, "Error during handling response mixer playbacks data '%s'", json_object_get_string(mixerPlaybacksJ)); if(mixerCapturesJ && (err += HalCtlsHandleMixerData(apiHandle, ¤tHalSpecificData->ctlHalCapturesData, mixerCapturesJ, MIXER_DATA_CAPTURES))) - AFB_ApiError(apiHandle, "%s: Error during handling response mixer captures data '%s'", __func__, json_object_get_string(mixerCapturesJ)); + AFB_ApiError(apiHandle, "Error during handling response mixer captures data '%s'", json_object_get_string(mixerCapturesJ)); return err; } @@ -190,29 +189,29 @@ int HalCtlsAttachToMixer(AFB_ApiT apiHandle) json_object *returnJ = NULL, *toReturnJ; if(! apiHandle) { - AFB_ApiError(apiHandle, "%s: Can't get current hal api handle", __func__); + AFB_ApiError(apiHandle, "Can't get current hal api handle"); return -1; } ctrlConfig = (CtlConfigT *) afb_dynapi_get_userdata(apiHandle); if(! ctrlConfig) { - AFB_ApiError(apiHandle, "%s: Can't get current hal controller config", __func__); + AFB_ApiError(apiHandle, "Can't get current hal controller config"); return -2; } currentCtlHalData = (struct SpecificHalData *) ctrlConfig->external; if(! currentCtlHalData) { - AFB_ApiError(apiHandle, "%s: Can't get current hal controller data", __func__); + AFB_ApiError(apiHandle, "Can't get current hal controller data"); return -3; } switch(currentCtlHalData->status) { case HAL_STATUS_UNAVAILABLE: - AFB_ApiError(apiHandle, "%s: Seems that the hal corresponding card was not found by alsacore at startup", __func__); + AFB_ApiError(apiHandle, "Seems that the hal corresponding card was not found by alsacore at startup"); return -4; case HAL_STATUS_READY: - AFB_ApiNotice(apiHandle, "%s: Seems that the hal mixer is already initialized", __func__); + AFB_ApiNotice(apiHandle, "Seems that the hal mixer is already initialized"); return 1; case HAL_STATUS_AVAILABLE: @@ -222,8 +221,7 @@ int HalCtlsAttachToMixer(AFB_ApiT apiHandle) firstHalData = HalMngGetFirstHalData(); if((concurentHalData = HalUtlSearchReadyHalDataByCarId(firstHalData, currentCtlHalData->sndCardId))) { AFB_ApiError(apiHandle, - "%s: trying to attach mixer for hal '%s' but the alsa device %i is already in use with mixer by hal '%s'", - __func__, + "Trying to attach mixer for hal '%s' but the alsa device %i is already in use with mixer by hal '%s'", currentCtlHalData->apiName, currentCtlHalData->sndCardId, concurentHalData->apiName); @@ -232,7 +230,7 @@ int HalCtlsAttachToMixer(AFB_ApiT apiHandle) apiToCall = currentCtlHalData->ctlHalSpecificData->mixerApiName; if(! apiToCall) { - AFB_ApiError(apiHandle, "%s: Can't get mixer api", __func__); + AFB_ApiError(apiHandle, "Can't get mixer api"); return -6; } @@ -249,8 +247,7 @@ int HalCtlsAttachToMixer(AFB_ApiT apiHandle) } else if(! json_object_object_get_ex(returnJ, "response", &toReturnJ)) { AFB_ApiError(apiHandle, - "%s: Seems that %s call to api %s succeed, but response is not valid : '%s'", - __func__, + "Seems that %s call to api %s succeed, but response is not valid : '%s'", MIXER_ATTACH_VERB, apiToCall, json_object_get_string(returnJ)); @@ -258,8 +255,7 @@ int HalCtlsAttachToMixer(AFB_ApiT apiHandle) } else if((mixerError = HalCtlsHandleMixerAttachResponse(apiHandle, currentCtlHalData->ctlHalSpecificData, toReturnJ)) != (int) MIXER_NO_ERROR) { AFB_ApiError(apiHandle, - "%s: Seems that %s call to api %s succeed but this warning was risen by response decoder : %i '%s'", - __func__, + "Seems that %s call to api %s succeed but this warning was risen by response decoder : %i '%s'", MIXER_ATTACH_VERB, apiToCall, mixerError, @@ -268,8 +264,7 @@ int HalCtlsAttachToMixer(AFB_ApiT apiHandle) } else { AFB_ApiNotice(apiHandle, - "%s: Seems that %s call to api %s succeed with no warning raised : '%s'", - __func__, + "Seems that %s call to api %s succeed with no warning raised : '%s'", MIXER_ATTACH_VERB, apiToCall, json_object_get_string(toReturnJ)); @@ -292,7 +287,7 @@ int HalCtlsGetInfoFromMixer(AFB_ApiT apiHandle, char *apiToCall, json_object *re json_object *returnJ, *responseJ; if(! apiHandle) { - AFB_ApiError(apiHandle, "%s: Can't get current hal api handle", __func__); + AFB_ApiError(apiHandle, "Can't get current hal api handle"); return -1; } @@ -319,8 +314,7 @@ int HalCtlsGetInfoFromMixer(AFB_ApiT apiHandle, char *apiToCall, json_object *re } else if(! json_object_object_get_ex(returnJ, "response", &responseJ)) { AFB_ApiError(apiHandle, - "%s: Seems that %s call to api %s succeed, but response is not valid : '%s'", - __func__, + "Seems that %s call to api %s succeed, but response is not valid : '%s'", MIXER_INFO_VERB, apiToCall, json_object_get_string(returnJ)); @@ -328,8 +322,7 @@ int HalCtlsGetInfoFromMixer(AFB_ApiT apiHandle, char *apiToCall, json_object *re } else { AFB_ApiNotice(apiHandle, - "%s: Seems that %s call to api %s succeed with no warning raised : '%s'", - __func__, + "Seems that %s call to api %s succeed with no warning raised : '%s'", MIXER_INFO_VERB, apiToCall, json_object_get_string(responseJ)); diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-value-handler.c b/4a-hal/4a-hal-controllers/4a-hal-controllers-value-handler.c index 3ab8178..f66c7ca 100644 --- a/4a-hal/4a-hal-controllers/4a-hal-controllers-value-handler.c +++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-value-handler.c @@ -76,7 +76,7 @@ int HalCtlsNormalizeJsonValues(AFB_ApiT apiHandle, struct CtlHalAlsaCtlPropertie case json_type_null: case json_type_object: count = 0; - AFB_ApiWarning(apiHandle, "%s: can't normalize json values :\n-- %s", __func__, json_object_get_string(toConvertJ)); + AFB_ApiWarning(apiHandle, "Can't normalize json values :\n-- %s", json_object_get_string(toConvertJ)); *ConvertedJ = json_object_get(toConvertJ); return -1; @@ -99,8 +99,7 @@ int HalCtlsNormalizeJsonValues(AFB_ApiT apiHandle, struct CtlHalAlsaCtlPropertie if(! json_object_is_type(toConvertObjectJ, json_type_int)) { err += -10*idx; AFB_ApiWarning(apiHandle, - "%s: Try normalize an integer control but value sent in json is not an integer : '%s'", - __func__, + "Try normalize an integer control but value sent in json is not an integer : '%s'", json_object_get_string(toConvertObjectJ)); convertedValueJ = toConvertObjectJ; break; @@ -110,8 +109,7 @@ int HalCtlsNormalizeJsonValues(AFB_ApiT apiHandle, struct CtlHalAlsaCtlPropertie convertedValue = HalCtlsConvertPercentageToValue(initialValue, alsaCtlProperties->minval, alsaCtlProperties->maxval); if(convertedValue == -INT_MAX) { AFB_ApiWarning(apiHandle, - "%s: Can't normalize %i (using min %i et max %i), value set to 0", - __func__, + "Can't normalize %i (using min %i et max %i), value set to 0", initialValue, alsaCtlProperties->minval, alsaCtlProperties->maxval); @@ -132,8 +130,7 @@ int HalCtlsNormalizeJsonValues(AFB_ApiT apiHandle, struct CtlHalAlsaCtlPropertie json_object_is_type(toConvertObjectJ, json_type_boolean))) { err += -1000*idx; AFB_ApiWarning(apiHandle, - "%s: Try normalize a boolean control but value sent in json is not a boolean/integer : '%s'", - __func__, + "Try normalize a boolean control but value sent in json is not a boolean/integer : '%s'", json_object_get_string(toConvertObjectJ)); convertedValueJ = toConvertObjectJ; break; @@ -145,8 +142,7 @@ int HalCtlsNormalizeJsonValues(AFB_ApiT apiHandle, struct CtlHalAlsaCtlPropertie default: AFB_ApiWarning(apiHandle, - "%s: Normalization not handle for the alsa control type %i, sending back the object as it was '%s'", - __func__, + "Normalization not handle for the alsa control type %i, sending back the object as it was '%s'", (int) alsaCtlProperties->type, json_object_get_string(toConvertJ)); convertedValueJ = toConvertObjectJ; |