@@ -3004,76 +3004,47 @@ PPH_STRING PhpDevSysPowerPowerDataString(
3004
3004
PPH_STRING capabilities ;
3005
3005
PPH_STRING string ;
3006
3006
3007
- PhInitFormatSR (& format [count ], * PhpDevPowerStateString (PowerData -> PD_MostRecentPowerState ));
3008
- count ++ ; // TODO(jxy-s) if PhInitFormat were inline instead of macros we could clean this up
3007
+ PhInitFormatSR (& format [count ++ ], * PhpDevPowerStateString (PowerData -> PD_MostRecentPowerState ));
3009
3008
if (PowerData -> PD_D1Latency )
3010
3009
{
3011
- PhInitFormatS (& format [count ], L", " );
3012
- count ++ ;
3013
- PhInitFormatU (& format [count ], PowerData -> PD_D1Latency );
3014
- count ++ ;
3015
- PhInitFormatS (& format [count ], L" D1 latency" );
3016
- count ++ ;
3010
+ PhInitFormatS (& format [count ++ ], L", " );
3011
+ PhInitFormatU (& format [count ++ ], PowerData -> PD_D1Latency );
3012
+ PhInitFormatS (& format [count ++ ], L" D1 latency" );
3017
3013
}
3018
3014
if (PowerData -> PD_D2Latency )
3019
3015
{
3020
- PhInitFormatS (& format [count ], L", " );
3021
- count ++ ;
3022
- PhInitFormatU (& format [count ], PowerData -> PD_D2Latency );
3023
- count ++ ;
3024
- PhInitFormatS (& format [count ], L" D2 latency" );
3025
- count ++ ;
3016
+ PhInitFormatS (& format [count ++ ], L", " );
3017
+ PhInitFormatU (& format [count ++ ], PowerData -> PD_D2Latency );
3018
+ PhInitFormatS (& format [count ++ ], L" D2 latency" );
3026
3019
}
3027
3020
if (PowerData -> PD_D2Latency )
3028
3021
{
3029
- PhInitFormatS (& format [count ], L", " );
3030
- count ++ ;
3031
- PhInitFormatU (& format [count ], PowerData -> PD_D3Latency );
3032
- count ++ ;
3033
- PhInitFormatS (& format [count ], L" D3 latency" );
3034
- count ++ ;
3022
+ PhInitFormatS (& format [count ++ ], L", " );
3023
+ PhInitFormatU (& format [count ++ ], PowerData -> PD_D3Latency );
3024
+ PhInitFormatS (& format [count ++ ], L" D3 latency" );
3035
3025
}
3036
- PhInitFormatS (& format [count ], L", S0->" );
3037
- count ++ ;
3038
- PhInitFormatSR (& format [count ], * PhpDevPowerStateString (PowerData -> PD_PowerStateMapping [PowerSystemWorking ]));
3039
- count ++ ;
3040
- PhInitFormatS (& format [count ], L", S1->" );
3041
- count ++ ;
3042
- PhInitFormatSR (& format [count ], * PhpDevPowerStateString (PowerData -> PD_PowerStateMapping [PowerSystemSleeping1 ]));
3043
- count ++ ;
3044
- PhInitFormatS (& format [count ], L", S2->" );
3045
- count ++ ;
3046
- PhInitFormatSR (& format [count ], * PhpDevPowerStateString (PowerData -> PD_PowerStateMapping [PowerSystemSleeping2 ]));
3047
- count ++ ;
3048
- PhInitFormatS (& format [count ], L", S3->" );
3049
- count ++ ;
3050
- PhInitFormatSR (& format [count ], * PhpDevPowerStateString (PowerData -> PD_PowerStateMapping [PowerSystemSleeping3 ]));
3051
- count ++ ;
3052
- PhInitFormatS (& format [count ], L", S4->" );
3053
- count ++ ;
3054
- PhInitFormatSR (& format [count ], * PhpDevPowerStateString (PowerData -> PD_PowerStateMapping [PowerSystemHibernate ]));
3055
- count ++ ;
3056
- PhInitFormatS (& format [count ], L", S5->" );
3057
- count ++ ;
3058
- PhInitFormatSR (& format [count ], * PhpDevPowerStateString (PowerData -> PD_PowerStateMapping [PowerSystemShutdown ]));
3059
- count ++ ;
3026
+ PhInitFormatS (& format [count ++ ], L", S0->" );
3027
+ PhInitFormatSR (& format [count ++ ], * PhpDevPowerStateString (PowerData -> PD_PowerStateMapping [PowerSystemWorking ]));
3028
+ PhInitFormatS (& format [count ++ ], L", S1->" );
3029
+ PhInitFormatSR (& format [count ++ ], * PhpDevPowerStateString (PowerData -> PD_PowerStateMapping [PowerSystemSleeping1 ]));
3030
+ PhInitFormatS (& format [count ++ ], L", S2->" );
3031
+ PhInitFormatSR (& format [count ++ ], * PhpDevPowerStateString (PowerData -> PD_PowerStateMapping [PowerSystemSleeping2 ]));
3032
+ PhInitFormatS (& format [count ++ ], L", S3->" );
3033
+ PhInitFormatSR (& format [count ++ ], * PhpDevPowerStateString (PowerData -> PD_PowerStateMapping [PowerSystemSleeping3 ]));
3034
+ PhInitFormatS (& format [count ++ ], L", S4->" );
3035
+ PhInitFormatSR (& format [count ++ ], * PhpDevPowerStateString (PowerData -> PD_PowerStateMapping [PowerSystemHibernate ]));
3036
+ PhInitFormatS (& format [count ++ ], L", S5->" );
3037
+ PhInitFormatSR (& format [count ++ ], * PhpDevPowerStateString (PowerData -> PD_PowerStateMapping [PowerSystemShutdown ]));
3060
3038
capabilities = PhGetAccessString (PowerData -> PD_Capabilities , (PVOID )pdCap , RTL_NUMBER_OF (pdCap ));
3061
- PhInitFormatS (& format [count ], L", (" );
3062
- count ++ ;
3063
- PhInitFormatSR (& format [count ], capabilities -> sr );
3064
- count ++ ;
3065
- PhInitFormatS (& format [count ], L" (0x" );
3066
- count ++ ;
3067
- PhInitFormatX (& format [count ], PowerData -> PD_Capabilities );
3068
- count ++ ;
3069
- PhInitFormatS (& format [count ], L"))" );
3070
- count ++ ;
3039
+ PhInitFormatS (& format [count ++ ], L", (" );
3040
+ PhInitFormatSR (& format [count ++ ], capabilities -> sr );
3041
+ PhInitFormatS (& format [count ++ ], L" (0x" );
3042
+ PhInitFormatX (& format [count ++ ], PowerData -> PD_Capabilities );
3043
+ PhInitFormatS (& format [count ++ ], L"))" );
3071
3044
if (PowerData -> PD_DeepestSystemWake != PowerSystemUnspecified )
3072
3045
{
3073
- PhInitFormatS (& format [count ], L", Deepest wake " );
3074
- count ++ ;
3075
- PhInitFormatSR (& format [count ], * PhpDevSysPowerStateString (PowerData -> PD_DeepestSystemWake ));
3076
- count ++ ;
3046
+ PhInitFormatS (& format [count ++ ], L", Deepest wake " );
3047
+ PhInitFormatSR (& format [count ++ ], * PhpDevSysPowerStateString (PowerData -> PD_DeepestSystemWake ));
3077
3048
}
3078
3049
3079
3050
string = PhFormat (format , count , 20 );
0 commit comments