llvm.org GIT mirror llvm / 2908ca7
Add explicit casts to silence warnings. There is no need to use snprintf here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14013 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 16 years ago
2 changed file(s) with 8 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
2727 if (X == 0) *--BufPtr = '0'; // Handle special case...
2828
2929 while (X) {
30 unsigned Mod = X & 15;
30 unsigned char Mod = unsigned char(X) & 15;
3131 if (Mod < 10)
3232 *--BufPtr = '0' + Mod;
3333 else
4545 if (X == 0) *--BufPtr = '0'; // Handle special case...
4646
4747 while (X) {
48 *--BufPtr = '0' + (X % 10);
48 *--BufPtr = '0' + char(X % 10);
4949 X /= 10;
5050 }
5151
7474 if (X == 0) *--BufPtr = '0'; // Handle special case...
7575
7676 while (X) {
77 *--BufPtr = '0' + (X % 10);
77 *--BufPtr = '0' + char(X % 10);
7878 X /= 10;
7979 }
8080
9292
9393 static inline std::string ftostr(double V) {
9494 char Buffer[200];
95 snprintf(Buffer, 200, "%20.6e", V);
95 sprintf(Buffer, "%20.6e", V);
9696 return Buffer;
9797 }
9898
2727 if (X == 0) *--BufPtr = '0'; // Handle special case...
2828
2929 while (X) {
30 unsigned Mod = X & 15;
30 unsigned char Mod = unsigned char(X) & 15;
3131 if (Mod < 10)
3232 *--BufPtr = '0' + Mod;
3333 else
4545 if (X == 0) *--BufPtr = '0'; // Handle special case...
4646
4747 while (X) {
48 *--BufPtr = '0' + (X % 10);
48 *--BufPtr = '0' + char(X % 10);
4949 X /= 10;
5050 }
5151
7474 if (X == 0) *--BufPtr = '0'; // Handle special case...
7575
7676 while (X) {
77 *--BufPtr = '0' + (X % 10);
77 *--BufPtr = '0' + char(X % 10);
7878 X /= 10;
7979 }
8080
9292
9393 static inline std::string ftostr(double V) {
9494 char Buffer[200];
95 snprintf(Buffer, 200, "%20.6e", V);
95 sprintf(Buffer, "%20.6e", V);
9696 return Buffer;
9797 }
9898