Also similarly simplify the use of the return value from WelsStrftime and GetCodeName/GetLibName/GetVerNum.
Showing the changes to codec/decoder (1 of 3 files). Show all
Unified · Split
| @@ -110,20 +110,16 @@ CWelsDecoder::CWelsDecoder (void) · 109 unmodified lines | ||
| 110 | 110 | iCurUsed = WelsSnprintf (chFileName, iBufLeft, "bs_0x%p_", (void*)this); |
| 111 | 111 | iCurUsedSize = WelsSnprintf (chFileNameSize, iBufLeftSize, "size_0x%p_", (void*)this); |
| 112 | 112 | |
| 113 | − if (iCurUsed > 0) { | |
| 114 | − iBufUsed += iCurUsed; | |
| 115 | − iBufLeft -= iCurUsed; | |
| 116 | − } | |
| 113 | + iBufUsed += iCurUsed; | |
| 114 | + iBufLeft -= iCurUsed; | |
| 117 | 115 | if (iBufLeft > 0) { |
| 118 | 116 | iCurUsed = WelsStrftime (&chFileName[iBufUsed], iBufLeft, "%y%m%d%H%M%S", &sCurTime); |
| 119 | 117 | iBufUsed += iCurUsed; |
| 120 | 118 | iBufLeft -= iCurUsed; |
| 121 | 119 | } |
| 122 | 120 | |
| 123 | − if (iCurUsedSize > 0) { | |
| 124 | − iBufUsedSize += iCurUsedSize; | |
| 125 | − iBufLeftSize -= iCurUsedSize; | |
| 126 | − } | |
| 121 | + iBufUsedSize += iCurUsedSize; | |
| 122 | + iBufLeftSize -= iCurUsedSize; | |
| 127 | 123 | if (iBufLeftSize > 0) { |
| 128 | 124 | iCurUsedSize = WelsStrftime (&chFileNameSize[iBufUsedSize], iBufLeftSize, "%y%m%d%H%M%S", &sCurTime); |
| 129 | 125 | iBufUsedSize += iCurUsedSize; |
| @@ -132,19 +128,15 @@ CWelsDecoder::CWelsDecoder (void) · 2 unmodified lines | ||
| 132 | 128 | |
| 133 | 129 | if (iBufLeft > 0) { |
| 134 | 130 | iCurUsed = WelsSnprintf (&chFileName[iBufUsed], iBufLeft, ".%03.3u.264", WelsGetMillisecond (&sCurTime)); |
| 135 | − if (iCurUsed > 0) { | |
| 136 | − iBufUsed += iCurUsed; | |
| 137 | − iBufLeft -= iCurUsed; | |
| 138 | − } | |
| 131 | + iBufUsed += iCurUsed; | |
| 132 | + iBufLeft -= iCurUsed; | |
| 139 | 133 | } |
| 140 | 134 | |
| 141 | 135 | if (iBufLeftSize > 0) { |
| 142 | 136 | iCurUsedSize = WelsSnprintf (&chFileNameSize[iBufUsedSize], iBufLeftSize, ".%03.3u.len", |
| 143 | 137 | WelsGetMillisecond (&sCurTime)); |
| 144 | − if (iCurUsedSize > 0) { | |
| 145 | − iBufUsedSize += iCurUsedSize; | |
| 146 | − iBufLeftSize -= iCurUsedSize; | |
| 147 | − } | |
| 138 | + iBufUsedSize += iCurUsedSize; | |
| 139 | + iBufLeftSize -= iCurUsedSize; | |
| 148 | 140 | } |
| 149 | 141 | |
| 150 | 142 | |