From b3454f1f78ddf29024e82c6fdaa56baca129ee7a Mon Sep 17 00:00:00 2001 From: s Date: Wed, 26 Jul 2023 16:30:40 +0800 Subject: [PATCH] fix clang build error --- fix-clang.patch | 662 ++++++++++++++++++++++++++++++++++++++++++++++++ openhpi.spec | 8 +- 2 files changed, 669 insertions(+), 1 deletion(-) create mode 100644 fix-clang.patch diff --git a/fix-clang.patch b/fix-clang.patch new file mode 100644 index 0000000..79373a0 --- /dev/null +++ b/fix-clang.patch @@ -0,0 +1,662 @@ +diff -u -r openhpi-3.8.0/plugins/dynamic_simulator/new_sim.cpp openhpi-3.8.0/plugins/dynamic_simulator/new_sim.cpp +--- openhpi-3.8.0/plugins/dynamic_simulator/new_sim.cpp 2018-03-09 02:10:28.000000000 +0800 ++++ openhpi-3.8.0/plugins/dynamic_simulator/new_sim.cpp 2023-07-26 15:47:50.000000000 +0800 +@@ -3580,438 +3580,7 @@ + * + */ + //@{ +-extern "C" { +- +-/// Alias definition +-void * oh_open (GHashTable *, unsigned int, oh_evt_queue *) +- __attribute__ ((weak, alias("NewSimulatorOpen"))); +- +-/// Alias definition +-void * oh_close (void *) __attribute__ ((weak, alias("NewSimulatorClose"))); +- +-/// Alias definition +-void * oh_get_event (void *) +- __attribute__ ((weak, alias("NewSimulatorGetEvent"))); +- +-/// Alias definition +-void * oh_discover_resources (void *) +- __attribute__ ((weak, alias("NewSimulatorDiscoverResources"))); +- +-/// Alias definition +-void * oh_set_resource_tag (void *, SaHpiResourceIdT, SaHpiTextBufferT *) +- __attribute__ ((weak, alias("NewSimulatorSetResourceTag"))); +- +-/// Alias definition +-void * oh_set_resource_severity (void *, SaHpiResourceIdT, SaHpiSeverityT) +- __attribute__ ((weak, alias("NewSimulatorSetResourceSeverity"))); +- +-/// Alias definition +-void * oh_get_el_info (void *, SaHpiResourceIdT, SaHpiEventLogInfoT *) +- __attribute__ ((weak, alias("NewSimulatorGetSelInfo"))); +- +-/// Alias definition +-void * oh_set_el_time (void *, SaHpiResourceIdT, const SaHpiEventT *) +- __attribute__ ((weak, alias("NewSimulatorSetSelTime"))); +- +-/// Alias definition +-void * oh_add_el_entry (void *, SaHpiResourceIdT, const SaHpiEventT *) +- __attribute__ ((weak, alias("NewSimulatorAddSelEntry"))); +- +-/// Alias definition +-void * oh_get_el_entry (void *, SaHpiResourceIdT, SaHpiEventLogEntryIdT, +- SaHpiEventLogEntryIdT *, SaHpiEventLogEntryIdT *, +- SaHpiEventLogEntryT *, SaHpiRdrT *, SaHpiRptEntryT *) +- __attribute__ ((weak, alias("NewSimulatorGetSelEntry"))); +- +-/// Alias definition +-void * oh_clear_el (void *, SaHpiResourceIdT) +- __attribute__ ((weak, alias("NewSimulatorClearSel"))); +- +-/// Alias definition +-void * oh_set_el_state (void *, SaHpiResourceIdT, SaHpiBoolT) +- __attribute__ ((weak, alias("NewSimulatorSetSelState"))); +- +-/// Alias definition +-void * oh_get_el_state (void *, SaHpiResourceIdT, SaHpiBoolT *) +- __attribute__ ((weak, alias("NewSimulatorGetSelState"))); +- +-/// Alias definition +-void * oh_get_el_caps (void *, SaHpiResourceIdT, SaHpiEventLogCapabilitiesT *) +- __attribute__ ((weak, alias("NewSimulatorGetSelCapability"))); +- +-/// Alias definition +-void * oh_reset_el_overflow (void *, SaHpiResourceIdT) +- __attribute__ ((weak, alias("NewSimulatorResetSelOverflow"))); +- +-/// Alias definition +-void * oh_get_sensor_reading (void *, SaHpiResourceIdT, +- SaHpiSensorNumT, +- SaHpiSensorReadingT *, +- SaHpiEventStateT *) +- __attribute__ ((weak, alias("NewSimulatorGetSensorReading"))); +- +-/// Alias definition +-void * oh_get_sensor_thresholds (void *, SaHpiResourceIdT, +- SaHpiSensorNumT, +- SaHpiSensorThresholdsT *) +- __attribute__ ((weak, alias("NewSimulatorGetSensorThresholds"))); +- +-/// Alias definition +-void * oh_set_sensor_thresholds (void *, SaHpiResourceIdT, +- SaHpiSensorNumT, +- const SaHpiSensorThresholdsT *) +- __attribute__ ((weak, alias("NewSimulatorSetSensorThresholds"))); +- +-/// Alias definition +-void * oh_get_sensor_enable (void *, SaHpiResourceIdT, +- SaHpiSensorNumT, +- SaHpiBoolT *) +- __attribute__ ((weak, alias("NewSimulatorGetSensorEnable"))); +- +-/// Alias definition +-void * oh_set_sensor_enable (void *, SaHpiResourceIdT, +- SaHpiSensorNumT, +- SaHpiBoolT) +- __attribute__ ((weak, alias("NewSimulatorSetSensorEnable"))); +- +-/// Alias definition +-void * oh_get_sensor_event_enables (void *, SaHpiResourceIdT, +- SaHpiSensorNumT, +- SaHpiBoolT *) +- __attribute__ ((weak, alias("NewSimulatorGetSensorEventEnables"))); +- +-/// Alias definition +-void * oh_set_sensor_event_enables (void *, SaHpiResourceIdT id, SaHpiSensorNumT, +- SaHpiBoolT *) +- __attribute__ ((weak, alias("NewSimulatorSetSensorEventEnables"))); +- +-/// Alias definition +-void * oh_get_sensor_event_masks (void *, SaHpiResourceIdT, SaHpiSensorNumT, +- SaHpiEventStateT *, SaHpiEventStateT *) +- __attribute__ ((weak, alias("NewSimulatorGetSensorEventMasks"))); +- +-/// Alias definition +-void * oh_set_sensor_event_masks (void *, SaHpiResourceIdT, SaHpiSensorNumT, +- SaHpiSensorEventMaskActionT, +- SaHpiEventStateT, +- SaHpiEventStateT) +- __attribute__ ((weak, alias("NewSimulatorSetSensorEventMasks"))); +- +-/// Alias definition +-void * oh_get_control_state (void *, SaHpiResourceIdT, SaHpiCtrlNumT, +- SaHpiCtrlModeT *, SaHpiCtrlStateT *) +- __attribute__ ((weak, alias("NewSimulatorGetControlState"))); +- +-/// Alias definition +-void * oh_set_control_state (void *, SaHpiResourceIdT,SaHpiCtrlNumT, +- SaHpiCtrlModeT, SaHpiCtrlStateT *) +- __attribute__ ((weak, alias("NewSimulatorSetControlState"))); +- +-/// Alias definition +-void * oh_get_idr_info (void *, SaHpiResourceIdT, SaHpiIdrIdT, SaHpiIdrInfoT *) +- __attribute__ ((weak, alias("NewSimulatorGetIdrInfo"))); +- +-/// Alias definition +-void * oh_get_idr_area_header (void *, SaHpiResourceIdT, SaHpiIdrIdT, +- SaHpiIdrAreaTypeT, SaHpiEntryIdT, SaHpiEntryIdT, +- SaHpiIdrAreaHeaderT) +- __attribute__ ((weak, alias("NewSimulatorGetIdrAreaHeader"))); +- +-/// Alias definition +-void * oh_add_idr_area (void *, SaHpiResourceIdT, SaHpiIdrIdT, SaHpiIdrAreaTypeT, +- SaHpiEntryIdT *) +- __attribute__ ((weak, alias("NewSimulatorAddIdrArea"))); +- +-/// Alias definition +-void * oh_add_idr_area_id (void *, SaHpiResourceIdT, SaHpiIdrIdT, SaHpiIdrAreaTypeT, +- SaHpiEntryIdT) +- __attribute__ ((weak, alias("NewSimulatorAddIdrAreaById"))); +- +-/// Alias definition +-void * oh_del_idr_area (void *, SaHpiResourceIdT, SaHpiIdrIdT, SaHpiEntryIdT) +- __attribute__ ((weak, alias("NewSimulatorDelIdrArea"))); +- +-/// Alias definition +-void * oh_get_idr_field (void *, SaHpiResourceIdT, SaHpiIdrIdT, SaHpiEntryIdT, +- SaHpiIdrFieldTypeT, SaHpiEntryIdT, SaHpiEntryIdT, +- SaHpiIdrFieldT) +- __attribute__ ((weak, alias("NewSimulatorGetIdrField"))); +- +-/// Alias definition +-void * oh_add_idr_field (void *, SaHpiResourceIdT, SaHpiIdrIdT, SaHpiIdrFieldT *) +- __attribute__ ((weak, alias("NewSimulatorAddIdrField"))); +- +-/// Alias definition +-void * oh_add_idr_field_id (void *, SaHpiResourceIdT, SaHpiIdrIdT, SaHpiIdrFieldT *) +- __attribute__ ((weak, alias("NewSimulatorAddIdrFieldById"))); +- +-/// Alias definition +-void * oh_set_idr_field (void *, SaHpiResourceIdT, SaHpiIdrIdT, SaHpiIdrFieldT) +- __attribute__ ((weak, alias("NewSimulatorSetIdrField"))); +- +-/// Alias definition +-void * oh_del_idr_field (void *, SaHpiResourceIdT, SaHpiIdrIdT, SaHpiEntryIdT, +- SaHpiEntryIdT) +- __attribute__ ((weak, alias("NewSimulatorDelIdrField"))); +- +-/// Alias definition +-void * oh_hotswap_policy_cancel (void *, SaHpiResourceIdT, SaHpiTimeoutT) +- __attribute__ ((weak, alias("NewSimulatorHotswapPolicyCancel"))); +- +-/// Alias definition +-void * oh_set_autoinsert_timeout (void *, SaHpiTimeoutT) +- __attribute__ ((weak, alias("NewSimulatorSetAutoInsertTimeout"))); +- +-/// Alias definition +-void * oh_get_autoextract_timeout (void *, SaHpiResourceIdT, SaHpiTimeoutT *) +- __attribute__ ((weak, alias("NewSimulatorGetAutoExtractTimeout"))); +- +-/// Alias definition +-void * oh_set_autoextract_timeout (void *, SaHpiResourceIdT, SaHpiTimeoutT) +- __attribute__ ((weak, alias("NewSimulatorSetAutoExtractTimeout"))); +- +-/// Alias definition +-void * oh_get_hotswap_state (void *, SaHpiResourceIdT, SaHpiHsStateT *) +- __attribute__ ((weak, alias("NewSimulatorGetHotswapState"))); +- +-/// Alias definition +-void * oh_set_hotswap_state (void *, SaHpiResourceIdT, SaHpiHsStateT) +- __attribute__ ((weak, alias("NewSimulatorSetHotswapState"))); +- +-/// Alias definition +-void * oh_request_hotswap_action (void *, SaHpiResourceIdT, SaHpiHsActionT) +- __attribute__ ((weak, alias("NewSimulatorRequestHotswapAction"))); +- +- +-/// Alias definition +-void * oh_get_power_state (void *, SaHpiResourceIdT, SaHpiPowerStateT *) +- __attribute__ ((weak, alias("NewSimulatorGetPowerState"))); +- +-/// Alias definition +-void * oh_set_power_state (void *, SaHpiResourceIdT, SaHpiPowerStateT) +- __attribute__ ((weak, alias("NewSimulatorSetPowerState"))); +- +-/// Alias definition +-void * oh_get_indicator_state (void *, SaHpiResourceIdT, +- SaHpiHsIndicatorStateT *) +- __attribute__ ((weak, alias("NewSimulatorGetIndicatorState"))); +- +-/// Alias definition +-void * oh_set_indicator_state (void *, SaHpiResourceIdT, +- SaHpiHsIndicatorStateT) +- __attribute__ ((weak, alias("NewSimulatorSetIndicatorState"))); +- +-/// Alias definition +-void * oh_control_parm (void *, SaHpiResourceIdT, SaHpiParmActionT) +- __attribute__ ((weak, alias("NewSimulatorControlParm"))); +- +-/// Alias definition +-void * oh_get_reset_state (void *, SaHpiResourceIdT, SaHpiResetActionT *) +- __attribute__ ((weak, alias("NewSimulatorGetResetState"))); +- +-/// Alias definition +-void * oh_set_reset_state (void *, SaHpiResourceIdT, SaHpiResetActionT) +- __attribute__ ((weak, alias("NewSimulatorSetResetState"))); +- +-/// Alias definition +-void * oh_get_watchdog_info (void *, SaHpiResourceIdT, SaHpiWatchdogNumT, +- SaHpiWatchdogT *) +- __attribute__ ((weak, alias("NewSimulatorGetWatchdogInfo"))); +- +-/// Alias definition +-void * oh_set_watchdog_info (void *, SaHpiResourceIdT, SaHpiWatchdogNumT, +- SaHpiWatchdogT *) +- __attribute__ ((weak, alias("NewSimulatorSetWatchdogInfo"))); +- +-/// Alias definition +-void * oh_reset_watchdog (void *, SaHpiResourceIdT , SaHpiWatchdogNumT ) +- __attribute__ ((weak, alias("NewSimulatorResetWatchdog"))); +- +-/// Alias definition +-void * oh_get_next_announce(void *, SaHpiResourceIdT, SaHpiAnnunciatorNumT, +- SaHpiSeverityT, SaHpiBoolT, SaHpiAnnouncementT *) +- __attribute__ ((weak, alias("NewSimulatorGetNextAnnouncement"))); +- +-/// Alias definition +-void * oh_get_announce(void *, SaHpiResourceIdT, SaHpiAnnunciatorNumT, +- SaHpiEntryIdT, SaHpiAnnouncementT *) +- __attribute__ ((weak, alias("NewSimulatorGetAnnouncement"))); +- +-/// Alias definition +-void * oh_ack_announce(void *, SaHpiResourceIdT, SaHpiAnnunciatorNumT, +- SaHpiEntryIdT, SaHpiSeverityT) +- __attribute__ ((weak, alias("NewSimulatorAckAnnouncement"))); +- +-/// Alias definition +-void * oh_add_announce(void *, SaHpiResourceIdT, SaHpiAnnunciatorNumT, +- SaHpiAnnouncementT *) +- __attribute__ ((weak, alias("NewSimulatorAddAnnouncement"))); +- +-/// Alias definition +-void * oh_del_announce(void *, SaHpiResourceIdT, SaHpiAnnunciatorNumT, +- SaHpiEntryIdT, SaHpiSeverityT) +- __attribute__ ((weak, alias("NewSimulatorDelAnnouncement"))); +- +-/// Alias definition +-void * oh_get_annunc_mode(void *, SaHpiResourceIdT, SaHpiAnnunciatorNumT, +- SaHpiAnnunciatorModeT *) +- __attribute__ ((weak, alias("NewSimulatorGetAnnMode"))); +- +-/// Alias definition +-void * oh_set_annunc_mode(void *, SaHpiResourceIdT, SaHpiAnnunciatorNumT, +- SaHpiAnnunciatorModeT) +- __attribute__ ((weak, alias("NewSimulatorSetAnnMode"))); +- +-/// Alias definition +-void * oh_get_fumi_spec(void *, SaHpiResourceIdT, SaHpiFumiNumT, +- SaHpiFumiSpecInfoT *) +- __attribute__ ((weak, alias("NewSimulatorGetFumiSpec"))); +- +-/// Alias definition +-void * oh_get_fumi_service_impact(void *, SaHpiResourceIdT, SaHpiFumiNumT, +- SaHpiFumiServiceImpactDataT *) +- __attribute__ ((weak, alias("NewSimulatorGetFumiServImpact"))); +- +-/// Alias definition +-void * oh_set_fumi_source(void *, SaHpiResourceIdT, SaHpiFumiNumT, +- SaHpiBankNumT, SaHpiTextBufferT *) +- __attribute__ ((weak, alias("NewSimulatorSetFumiSource"))); +- +-/// Alias definition +-void * oh_validate_fumi_source(void *, SaHpiResourceIdT, SaHpiFumiNumT, SaHpiBankNumT) +- __attribute__ ((weak, alias("NewSimulatorValidateFumiSource"))); +- +-/// Alias definition +-void * oh_get_fumi_source(void *, SaHpiResourceIdT, SaHpiFumiNumT, SaHpiBankNumT, +- SaHpiFumiSourceInfoT *) +- __attribute__ ((weak, alias("NewSimulatorGetFumiSource"))); +- +-/// Alias definition +-void * oh_get_fumi_source_component(void *, SaHpiResourceIdT, SaHpiFumiNumT, +- SaHpiBankNumT, SaHpiEntryIdT, +- SaHpiEntryIdT *, SaHpiFumiComponentInfoT *) +- __attribute__ ((weak, alias("NewSimulatorGetFumiSourceComponent"))); +- +-/// Alias definition +-void * oh_get_fumi_target(void *, SaHpiResourceIdT, SaHpiFumiNumT, +- SaHpiBankNumT, SaHpiFumiBankInfoT *) +- __attribute__ ((weak, alias("NewSimulatorGetFumiTarget"))); +- +-/// Alias definition +-void * oh_get_fumi_target_component(void *, SaHpiResourceIdT, SaHpiFumiNumT, +- SaHpiBankNumT, SaHpiEntryIdT, +- SaHpiEntryIdT *, SaHpiFumiComponentInfoT *) +- __attribute__ ((weak, alias("NewSimulatorGetFumiTargetComponent"))); +- +-/// Alias definition +-void * oh_get_fumi_logical_target(void *, SaHpiResourceIdT, SaHpiFumiNumT, +- SaHpiFumiLogicalBankInfoT *) +- __attribute__ ((weak, alias("NewSimulatorGetFumiLogicalTarget"))); +- +-/// Alias definition +-void * oh_get_fumi_logical_target_component(void *, SaHpiResourceIdT, SaHpiFumiNumT, +- SaHpiEntryIdT, SaHpiEntryIdT *, +- SaHpiFumiLogicalComponentInfoT *) +- __attribute__ ((weak, alias("NewSimulatorGetFumiLogicalTargetComponent"))); +- +-/// Alias definition +-void * oh_start_fumi_backup(void *, SaHpiResourceIdT, SaHpiFumiNumT) +- __attribute__ ((weak, alias("NewSimulatorStartFumiBackup"))); +- +-/// Alias definition +-void * oh_set_fumi_bank_order(void *, SaHpiResourceIdT, SaHpiFumiNumT, +- SaHpiBankNumT, SaHpiUint32T) +- __attribute__ ((weak, alias("NewSimulatorSetFumiBankOrder"))); +- +-/// Alias definition +-void * oh_start_fumi_bank_copy(void *, SaHpiResourceIdT, SaHpiFumiNumT, +- SaHpiBankNumT, SaHpiBankNumT) +- __attribute__ ((weak, alias("NewSimulatorStartFumiBankCopy"))); +- +-/// Alias definition +-void * oh_start_fumi_install(void *, SaHpiResourceIdT, SaHpiFumiNumT, SaHpiBankNumT) +- __attribute__ ((weak, alias("NewSimulatorStartFumiInstall"))); +- +-/// Alias definition +-void * oh_get_fumi_status(void *, SaHpiResourceIdT, SaHpiFumiNumT, SaHpiBankNumT, +- SaHpiFumiUpgradeStatusT *) +- __attribute__ ((weak, alias("NewSimulatorGetFumiStatus"))); +- +-/// Alias definition +-void * oh_start_fumi_verify(void *, SaHpiResourceIdT, SaHpiFumiNumT, SaHpiBankNumT) +- __attribute__ ((weak, alias("NewSimulatorStartFumiVerification"))); +- +-/// Alias definition +-void * oh_start_fumi_verify_main(void *, SaHpiResourceIdT, SaHpiFumiNumT) +- __attribute__ ((weak, alias("NewSimulatorStartFumiVerificationMain"))); +- +-/// Alias definition +-void * oh_cancel_fumi_upgrade(void *, SaHpiResourceIdT, SaHpiFumiNumT, SaHpiBankNumT) +- __attribute__ ((weak, alias("NewSimulatorCancelFumiUpgrade"))); +- +-/// Alias definition +-void * oh_get_fumi_autorollback_disable(void *, SaHpiResourceIdT, SaHpiFumiNumT, +- SaHpiBoolT *) +- __attribute__ ((weak, alias("NewSimulatorGetFumiRollback"))); +- +-/// Alias definition +-void * oh_set_fumi_autorollback_disable(void *, SaHpiResourceIdT, SaHpiFumiNumT, +- SaHpiBoolT) +- __attribute__ ((weak, alias("NewSimulatorSetFumiRollback"))); +- +-/// Alias definition +-void * oh_start_fumi_rollback(void *, SaHpiResourceIdT, SaHpiFumiNumT) +- __attribute__ ((weak, alias("NewSimulatorStartFumiRollback"))); +- +-/// Alias definition +-void * oh_activate_fumi(void *, SaHpiResourceIdT, SaHpiFumiNumT) +- __attribute__ ((weak, alias("NewSimulatorActivateFumi"))); +- +-/// Alias definition +-void * oh_start_fumi_activate(void *, SaHpiResourceIdT, SaHpiFumiNumT, SaHpiBoolT) +- __attribute__ ((weak, alias("NewSimulatorStartFumiActivation"))); +- +-/// Alias definition +-void * oh_cleanup_fumi(void *, SaHpiResourceIdT, SaHpiFumiNumT, SaHpiBankNumT) +- __attribute__ ((weak, alias("NewSimulatorCleanupFumi"))); +- +-/// Alias definition +-void * oh_get_dimi_info(void *, SaHpiResourceIdT, SaHpiDimiNumT, SaHpiDimiInfoT *) +- __attribute__ ((weak, alias("NewSimulatorGetDimiInfo"))); +- +-/// Alias definition +-void * oh_get_dimi_test(void *, SaHpiResourceIdT, SaHpiDimiNumT, +- SaHpiDimiTestNumT, SaHpiDimiTestT *) +- __attribute__ ((weak, alias("NewSimulatorGetDimiTestInfo"))); +- +-/// Alias definition +-void * oh_get_dimi_test_ready(void *, SaHpiResourceIdT, SaHpiDimiNumT, +- SaHpiDimiTestNumT, SaHpiDimiReadyT *) +- __attribute__ ((weak, alias("NewSimulatorGetDimiTestReadiness"))); +- +-/// Alias definition +-void * oh_start_dimi_test(void *, SaHpiResourceIdT, SaHpiDimiNumT, SaHpiDimiTestNumT, +- SaHpiUint8T, SaHpiDimiTestVariableParamsT *) +- __attribute__ ((weak, alias("NewSimulatorStartDimiTest"))); +- +-/// Alias definition +-void * oh_cancel_dimi_test(void *, SaHpiResourceIdT, SaHpiDimiNumT, +- SaHpiDimiTestNumT) +- __attribute__ ((weak, alias("NewSimulatorCancelDimiTest"))); +- +-/// Alias definition +-void * oh_get_dimi_test_status(void *, SaHpiResourceIdT, SaHpiDimiNumT, +- SaHpiDimiTestNumT, +- SaHpiDimiTestPercentCompletedT *, +- SaHpiDimiTestRunStatusT *) +- __attribute__ ((weak, alias("NewSimulatorGetDimiTestStatus"))); + +-/// Alias definition +-void * oh_get_dimi_test_results(void *, SaHpiResourceIdT, SaHpiDimiNumT, +- SaHpiDimiTestNumT, SaHpiDimiTestResultsT *) +- __attribute__ ((weak, alias("NewSimulatorGetDimiTestResults"))); +- +-} + //@} + + +diff -u -r openhpi-3.8.0/plugins/dynamic_simulator/new_sim_file.cpp openhpi-3.8.0/plugins/dynamic_simulator/new_sim_file.cpp +--- openhpi-3.8.0/plugins/dynamic_simulator/new_sim_file.cpp 2018-03-09 02:10:28.000000000 +0800 ++++ openhpi-3.8.0/plugins/dynamic_simulator/new_sim_file.cpp 2023-07-26 16:08:33.000000000 +0800 +@@ -44,9 +44,9 @@ + ///< Global skip characters for oh_scanner_config + static gchar skip_characters[] = " \t\n"; + ///< Global identifier_first for oh_scanner_config +-static gchar identifier_first[] = G_CSET_a_2_z"_/."G_CSET_A_2_Z; ++static gchar identifier_first[] = G_CSET_a_2_z "_/." G_CSET_A_2_Z; + ///< Global identifier_nth for oh_scanner_config +-static gchar identifier_nth[] = G_CSET_a_2_z"_-0123456789/."G_CSET_A_2_Z; ++static gchar identifier_nth[] = G_CSET_a_2_z "_-0123456789/." G_CSET_A_2_Z; + ///< Global comment signs for oh_scanner_config + static gchar comment_single[] = "#\n"; + +diff -u -r openhpi-3.8.0/plugins/ipmidirect/ipmi.cpp openhpi-3.8.0/plugins/ipmidirect/ipmi.cpp +--- openhpi-3.8.0/plugins/ipmidirect/ipmi.cpp 2018-03-09 02:10:50.000000000 +0800 ++++ openhpi-3.8.0/plugins/ipmidirect/ipmi.cpp 2023-07-26 15:43:46.000000000 +0800 +@@ -1556,177 +1556,6 @@ + + } // new plugin_loader + +-extern "C" { +- +-void * oh_open (GHashTable *, unsigned int, oh_evt_queue *) __attribute__ ((weak, alias("IpmiOpen"))); +- +-void * oh_close (void *) __attribute__ ((weak, alias("IpmiClose"))); +- +-void * oh_get_event (void *) +- __attribute__ ((weak, alias("IpmiGetEvent"))); +- +-void * oh_discover_resources (void *) +- __attribute__ ((weak, alias("IpmiDiscoverResources"))); +- +-void * oh_set_resource_tag (void *, SaHpiResourceIdT, SaHpiTextBufferT *) +- __attribute__ ((weak, alias("IpmiSetResourceTag"))); +- +-void * oh_set_resource_severity (void *, SaHpiResourceIdT, SaHpiSeverityT) +- __attribute__ ((weak, alias("IpmiSetResourceSeverity"))); +- +-void * oh_get_el_info (void *, SaHpiResourceIdT, SaHpiEventLogInfoT *) +- __attribute__ ((weak, alias("IpmiGetSelInfo"))); +- +-void * oh_set_el_time (void *, SaHpiResourceIdT, const SaHpiEventT *) +- __attribute__ ((weak, alias("IpmiSetSelTime"))); +- +-void * oh_add_el_entry (void *, SaHpiResourceIdT, const SaHpiEventT *) +- __attribute__ ((weak, alias("IpmiAddSelEntry"))); +- +-void * oh_get_el_entry (void *, SaHpiResourceIdT, SaHpiEventLogEntryIdT, +- SaHpiEventLogEntryIdT *, SaHpiEventLogEntryIdT *, +- SaHpiEventLogEntryT *, SaHpiRdrT *, SaHpiRptEntryT *) +- __attribute__ ((weak, alias("IpmiGetSelEntry"))); +- +-void * oh_clear_el (void *, SaHpiResourceIdT) +- __attribute__ ((weak, alias("IpmiClearSel"))); +- +-void * oh_get_sensor_reading (void *, SaHpiResourceIdT, +- SaHpiSensorNumT, +- SaHpiSensorReadingT *, +- SaHpiEventStateT *) +- __attribute__ ((weak, alias("IpmiGetSensorReading"))); +- +-void * oh_get_sensor_thresholds (void *, SaHpiResourceIdT, +- SaHpiSensorNumT, +- SaHpiSensorThresholdsT *) +- __attribute__ ((weak, alias("IpmiGetSensorThresholds"))); +- +-void * oh_set_sensor_thresholds (void *, SaHpiResourceIdT, +- SaHpiSensorNumT, +- const SaHpiSensorThresholdsT *) +- __attribute__ ((weak, alias("IpmiSetSensorThresholds"))); +- +-void * oh_get_sensor_enable (void *, SaHpiResourceIdT, +- SaHpiSensorNumT, +- SaHpiBoolT *) +- __attribute__ ((weak, alias("IpmiGetSensorEnable"))); +- +-void * oh_set_sensor_enable (void *, SaHpiResourceIdT, +- SaHpiSensorNumT, +- SaHpiBoolT) +- __attribute__ ((weak, alias("IpmiSetSensorEnable"))); +- +-void * oh_get_sensor_event_enables (void *, SaHpiResourceIdT, +- SaHpiSensorNumT, +- SaHpiBoolT *) +- __attribute__ ((weak, alias("IpmiGetSensorEventEnables"))); +- +-void * oh_set_sensor_event_enables (void *, SaHpiResourceIdT id, SaHpiSensorNumT, +- SaHpiBoolT *) +- __attribute__ ((weak, alias("IpmiSetSensorEventEnables"))); +- +-void * oh_get_sensor_event_masks (void *, SaHpiResourceIdT, SaHpiSensorNumT, +- SaHpiEventStateT *, SaHpiEventStateT *) +- __attribute__ ((weak, alias("IpmiGetSensorEventMasks"))); +- +-void * oh_set_sensor_event_masks (void *, SaHpiResourceIdT, SaHpiSensorNumT, +- SaHpiSensorEventMaskActionT, +- SaHpiEventStateT, +- SaHpiEventStateT) +- __attribute__ ((weak, alias("IpmiSetSensorEventMasks"))); +- +-void * oh_get_control_state (void *, SaHpiResourceIdT, SaHpiCtrlNumT, +- SaHpiCtrlModeT *, SaHpiCtrlStateT *) +- __attribute__ ((weak, alias("IpmiGetControlState"))); +- +-void * oh_set_control_state (void *, SaHpiResourceIdT,SaHpiCtrlNumT, +- SaHpiCtrlModeT, SaHpiCtrlStateT *) +- __attribute__ ((weak, alias("IpmiSetControlState"))); +- +-void * oh_get_idr_info (void *hnd, SaHpiResourceIdT, SaHpiIdrIdT,SaHpiIdrInfoT) +- __attribute__ ((weak, alias("IpmiGetIdrInfo"))); +- +-void * oh_get_idr_area_header (void *, SaHpiResourceIdT, SaHpiIdrIdT, +- SaHpiIdrAreaTypeT, SaHpiEntryIdT, SaHpiEntryIdT, +- SaHpiIdrAreaHeaderT) +- __attribute__ ((weak, alias("IpmiGetIdrAreaHeader"))); +- +-void * oh_add_idr_area (void *, SaHpiResourceIdT, SaHpiIdrIdT, SaHpiIdrAreaTypeT, +- SaHpiEntryIdT) +- __attribute__ ((weak, alias("IpmiAddIdrArea"))); +- +-void * oh_del_idr_area (void *, SaHpiResourceIdT, SaHpiIdrIdT, SaHpiEntryIdT) +- __attribute__ ((weak, alias("IpmiDelIdrArea"))); +- +-void * oh_get_idr_field (void *, SaHpiResourceIdT, SaHpiIdrIdT, SaHpiEntryIdT, +- SaHpiIdrFieldTypeT, SaHpiEntryIdT, SaHpiEntryIdT, +- SaHpiIdrFieldT) +- __attribute__ ((weak, alias("IpmiGetIdrField"))); +- +-void * oh_add_idr_field (void *, SaHpiResourceIdT, SaHpiIdrIdT, SaHpiIdrFieldT) +- __attribute__ ((weak, alias("IpmiAddIdrField"))); +- +-void * oh_set_idr_field (void *, SaHpiResourceIdT, SaHpiIdrIdT, SaHpiIdrFieldT) +- __attribute__ ((weak, alias("IpmiSetIdrField"))); +- +-void * oh_del_idr_field (void *, SaHpiResourceIdT, SaHpiIdrIdT, SaHpiEntryIdT, +- SaHpiEntryIdT) +- __attribute__ ((weak, alias("IpmiDelIdrField"))); +- +-void * oh_hotswap_policy_cancel (void *, SaHpiResourceIdT, SaHpiTimeoutT) +- __attribute__ ((weak, alias("IpmiHotswapPolicyCancel"))); +- +-void * oh_set_autoinsert_timeout (void *, SaHpiTimeoutT) +- __attribute__ ((weak, alias("IpmiSetAutoInsertTimeout"))); +- +-void * oh_get_autoextract_timeout (void *, SaHpiResourceIdT, SaHpiTimeoutT *) +- __attribute__ ((weak, alias("IpmiGetAutoExtractTimeout"))); +- +-void * oh_set_autoextract_timeout (void *, SaHpiResourceIdT, SaHpiTimeoutT) +- __attribute__ ((weak, alias("IpmiSetAutoExtractTimeout"))); +- +-void * oh_get_hotswap_state (void *, SaHpiResourceIdT, SaHpiHsStateT *) +- __attribute__ ((weak, alias("IpmiGetHotswapState"))); +- +-void * oh_set_hotswap_state (void *, SaHpiResourceIdT, SaHpiHsStateT) +- __attribute__ ((weak, alias("IpmiSetHotswapState"))); +- +-void * oh_request_hotswap_action (void *, SaHpiResourceIdT, SaHpiHsActionT) +- __attribute__ ((weak, alias("IpmiRequestHotswapAction"))); +- +-void * oh_get_power_state (void *, SaHpiResourceIdT, SaHpiPowerStateT *) +- __attribute__ ((weak, alias("IpmiGetPowerState"))); +- +-void * oh_set_power_state (void *, SaHpiResourceIdT, SaHpiPowerStateT) +- __attribute__ ((weak, alias("IpmiSetPowerState"))); +- +-void * oh_get_indicator_state (void *, SaHpiResourceIdT, +- SaHpiHsIndicatorStateT *) +- __attribute__ ((weak, alias("IpmiGetIndicatorState"))); +- +-void * oh_set_indicator_state (void *, SaHpiResourceIdT, +- SaHpiHsIndicatorStateT) +- __attribute__ ((weak, alias("IpmiSetIndicatorState"))); +- +-void * oh_control_parm (void *, SaHpiResourceIdT, SaHpiParmActionT) +- __attribute__ ((weak, alias("IpmiControlParm"))); +- +-void * oh_get_reset_state (void *, SaHpiResourceIdT, SaHpiResetActionT *) +- __attribute__ ((weak, alias("IpmiGetResetState"))); +- +-void * oh_set_reset_state (void *, SaHpiResourceIdT, SaHpiResetActionT) +- __attribute__ ((weak, alias("IpmiSetResetState"))); +- +-void * oh_get_watchdog_info (void *, SaHpiResourceIdT, SaHpiWatchdogNumT, +- SaHpiWatchdogT *) +- __attribute__ ((weak, alias("IpmiGetWatchdogInfo"))); +-void * oh_set_watchdog_info (void *, SaHpiResourceIdT, SaHpiWatchdogNumT, +- SaHpiWatchdogT *) +- __attribute__ ((weak, alias("IpmiSetWatchdogInfo"))); +-void * oh_reset_watchdog (void *, SaHpiResourceIdT , SaHpiWatchdogNumT ) +- __attribute__ ((weak, alias("IpmiResetWatchdog"))); +-} + + + static unsigned int +diff -u -r openhpi-3.8.0/plugins/ipmidirect/t/sensor_factors_000.cpp openhpi-3.8.0/plugins/ipmidirect/t/sensor_factors_000.cpp +--- openhpi-3.8.0/plugins/ipmidirect/t/sensor_factors_000.cpp 2018-03-09 02:10:39.000000000 +0800 ++++ openhpi-3.8.0/plugins/ipmidirect/t/sensor_factors_000.cpp 2023-07-26 15:56:44.000000000 +0800 +@@ -63,7 +63,7 @@ + dB & 0xff, + ((dB >> 2) & 0xc0) | (dAccuracy & 0x3f), + ((dAccuracy >> 2) & 0xf0) | ((dAccuracyExp << 2) & 0x0c), +- ((dRExp << 4) & 0xf0) | (dBExp & 0x0f ), ++ static_cast(((dRExp << 4) & 0xf0) | (dBExp & 0x0f )), + 0, + 0, + } +diff -u -r openhpi-3.8.0/plugins/ov_rest/ov_rest_re_discover.c openhpi-3.8.0/plugins/ov_rest/ov_rest_re_discover.c +--- openhpi-3.8.0/plugins/ov_rest/ov_rest_re_discover.c 2018-03-09 02:10:16.000000000 +0800 ++++ openhpi-3.8.0/plugins/ov_rest/ov_rest_re_discover.c 2023-07-26 15:49:32.000000000 +0800 +@@ -704,7 +704,7 @@ + byte bayNumber) + { + +- SaErrorT rv = NULL; ++ SaErrorT rv = 0; + SaHpiResourceIdT resource_id = 0; + struct oh_event event = {0}; + struct ovRestHotswapState *hotswap_state = NULL; diff --git a/openhpi.spec b/openhpi.spec index b26f1a8..ee10988 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -1,12 +1,15 @@ Name: openhpi Version: 3.8.0 -Release: 9 +Release: 10 Summary: Implementation of the Service Availability Forum's Hardware Platform Interface License: BSD-3-Clause URL: http://www.openhpi.org Source0: https://github.com/open-hpi/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz Patch0: openhpi-3.4.0-systemd.patch Patch1: openhpi-3.6.1-ssl.patch +%if "%toolchain" == "clang" +Patch2: fix-clang.patch +%endif BuildRequires: glib2-devel gcc-c++ libsysfs-devel net-snmp-devel OpenIPMI-devel libtool-ltdl-devel BuildRequires: openssl-devel ncurses-devel libxml2-devel docbook-utils libuuid-devel librabbitmq-devel @@ -111,6 +114,9 @@ make check %{_mandir}/man8/*8* %changelog +* Wed Jul 26 2023 yoo - 3.8.0-10 +- fix clang build error + * Tue May 10 2022 yaoxin - 3.8.0-9 - License compliance rectification -- Gitee