Changeset 93301 in vbox for trunk/src/VBox/Runtime/common/checksum
- Timestamp:
- Jan 18, 2022 11:24:43 AM (3 years ago)
- Location:
- trunk/src/VBox/Runtime/common/checksum
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/checksum/RTSha1Digest.cpp
r93115 r93301 58 58 59 59 /* Buffer size for progress callback */ 60 double rdMulti = 100.0 / (cbBuf ? cbBuf : 1);60 double rdMulti = 100.0 / (cbBuf ? (double)cbBuf : 1.0); 61 61 62 62 /* Working buffer */ … … 75 75 if (pfnProgressCallback) 76 76 { 77 rc = pfnProgressCallback((unsigned)( cbReadTotal * rdMulti), pvUser);77 rc = pfnProgressCallback((unsigned)((double)cbReadTotal * rdMulti), pvUser); 78 78 if (RT_FAILURE(rc)) 79 79 break; /* canceled */ … … 120 120 121 121 /* Fetch the file size. Only needed if there is a progress callback. */ 122 double rdMulti = 0 ;122 double rdMulti = 0.0; 123 123 if (pfnProgressCallback) 124 124 { … … 130 130 return rc; 131 131 } 132 rdMulti = 100.0 / (cbFile ? cbFile : 1);132 rdMulti = 100.0 / (cbFile ? (double)cbFile : 1.0); 133 133 } 134 134 … … 161 161 if (pfnProgressCallback) 162 162 { 163 rc = pfnProgressCallback((unsigned)( cbReadTotal * rdMulti), pvUser);163 rc = pfnProgressCallback((unsigned)((double)cbReadTotal * rdMulti), pvUser); 164 164 if (RT_FAILURE(rc)) 165 165 break; /* canceled */ -
trunk/src/VBox/Runtime/common/checksum/RTSha256Digest.cpp
r93115 r93301 58 58 59 59 /* Buffer size for progress callback */ 60 double rdMulti = 100.0 / (cbBuf ? cbBuf : 1);60 double rdMulti = 100.0 / (cbBuf ? (double)cbBuf : 1); 61 61 62 62 /* Working buffer */ … … 75 75 if (pfnProgressCallback) 76 76 { 77 rc = pfnProgressCallback((unsigned)( cbReadTotal * rdMulti), pvUser);77 rc = pfnProgressCallback((unsigned)((double)cbReadTotal * rdMulti), pvUser); 78 78 if (RT_FAILURE(rc)) 79 79 break; /* canceled */ … … 124 124 125 125 /* Fetch the file size. Only needed if there is a progress callback. */ 126 double rdMulti = 0 ;126 double rdMulti = 0.0; 127 127 if (pfnProgressCallback) 128 128 { … … 134 134 return rc; 135 135 } 136 rdMulti = 100.0 / (cbFile ? cbFile : 1);136 rdMulti = 100.0 / (cbFile ? (double)cbFile : 1.0); 137 137 } 138 138 … … 161 161 if (pfnProgressCallback) 162 162 { 163 rc = pfnProgressCallback((unsigned)( cbReadTotal * rdMulti), pvUser);163 rc = pfnProgressCallback((unsigned)((double)cbReadTotal * rdMulti), pvUser); 164 164 if (RT_FAILURE(rc)) 165 165 break; /* canceled */
Note:
See TracChangeset
for help on using the changeset viewer.