comparison src/os_mswin.c @ 840:2c885fab04e3 v7.0e06

updated for version 7.0e06
author vimboss
date Sat, 22 Apr 2006 22:33:57 +0000
parents 8bebcabccc2c
children 9f279ebda751
comparison
equal deleted inserted replaced
839:1f3b1021f002 840:2c885fab04e3
768 768
769 /* get memory information */ 769 /* get memory information */
770 if (VirtualQuery(str, &mbi, sizeof(mbi))) 770 if (VirtualQuery(str, &mbi, sizeof(mbi)))
771 { 771 {
772 /* pre cast these (typing savers) */ 772 /* pre cast these (typing savers) */
773 DWORD dwStr = (DWORD)str; 773 long_u dwStr = (long_u)str;
774 DWORD dwBaseAddress = (DWORD)mbi.BaseAddress; 774 long_u dwBaseAddress = (long_u)mbi.BaseAddress;
775 775
776 /* get start address of page that str is on */ 776 /* get start address of page that str is on */
777 DWORD strPage = dwStr - (dwStr - dwBaseAddress) % si.dwPageSize; 777 long_u strPage = dwStr - (dwStr - dwBaseAddress) % si.dwPageSize;
778 778
779 /* get length from str to end of page */ 779 /* get length from str to end of page */
780 DWORD pageLength = si.dwPageSize - (dwStr - strPage); 780 long_u pageLength = si.dwPageSize - (dwStr - strPage);
781 781
782 for (p = str; !IsBadReadPtr(p, pageLength); 782 for (p = str; !IsBadReadPtr(p, pageLength);
783 p += pageLength, pageLength = si.dwPageSize) 783 p += pageLength, pageLength = si.dwPageSize)
784 for (i = 0; i < pageLength; ++i, ++length) 784 for (i = 0; i < pageLength; ++i, ++length)
785 if (p[i] == NUL) 785 if (p[i] == NUL)
2623 2))) == FAIL) 2623 2))) == FAIL)
2624 vim_free(str); 2624 vim_free(str);
2625 #ifdef FEAT_AUTOCMD 2625 #ifdef FEAT_AUTOCMD
2626 else if (data->dwData == COPYDATA_REPLY) 2626 else if (data->dwData == COPYDATA_REPLY)
2627 { 2627 {
2628 sprintf((char *)winstr, "0x%x", (unsigned)sender); 2628 sprintf((char *)winstr, PRINTF_HEX_LONG_U, (long_u)sender);
2629 apply_autocmds(EVENT_REMOTEREPLY, winstr, str, 2629 apply_autocmds(EVENT_REMOTEREPLY, winstr, str,
2630 TRUE, curbuf); 2630 TRUE, curbuf);
2631 } 2631 }
2632 #endif 2632 #endif
2633 } 2633 }
2832 char_u *name; /* Where to send. */ 2832 char_u *name; /* Where to send. */
2833 char_u *reply; /* What to send. */ 2833 char_u *reply; /* What to send. */
2834 { 2834 {
2835 HWND target; 2835 HWND target;
2836 COPYDATASTRUCT data; 2836 COPYDATASTRUCT data;
2837 int n = 0; 2837 long_u n = 0;
2838 2838
2839 /* The "name" argument is a magic cookie obtained from expand("<client>"). 2839 /* The "name" argument is a magic cookie obtained from expand("<client>").
2840 * It should be of the form 0xXXXXX - i.e. a C hex literal, which is the 2840 * It should be of the form 0xXXXXX - i.e. a C hex literal, which is the
2841 * value of the client's message window HWND. 2841 * value of the client's message window HWND.
2842 */ 2842 */
2843 sscanf((char *)name, "%x", &n); 2843 sscanf((char *)name, SCANF_HEX_LONG_U, &n);
2844 if (n == 0) 2844 if (n == 0)
2845 return -1; 2845 return -1;
2846 2846
2847 target = (HWND)n; 2847 target = (HWND)n;
2848 if (!IsWindow(target)) 2848 if (!IsWindow(target))
3128 * "10.5"). The pixel value is returned, and a pointer to the next unconverted 3128 * "10.5"). The pixel value is returned, and a pointer to the next unconverted
3129 * character is stored in *end. The flag "vertical" says whether this 3129 * character is stored in *end. The flag "vertical" says whether this
3130 * calculation is for a vertical (height) size or a horizontal (width) one. 3130 * calculation is for a vertical (height) size or a horizontal (width) one.
3131 */ 3131 */
3132 static int 3132 static int
3133 points_to_pixels(char_u *str, char_u **end, int vertical, int pprinter_dc) 3133 points_to_pixels(char_u *str, char_u **end, int vertical, long_i pprinter_dc)
3134 { 3134 {
3135 int pixels; 3135 int pixels;
3136 int points = 0; 3136 int points = 0;
3137 int divisor = 0; 3137 int divisor = 0;
3138 HWND hwnd = (HWND)0; 3138 HWND hwnd = (HWND)0;
3336 while (*p) 3336 while (*p)
3337 { 3337 {
3338 switch (*p++) 3338 switch (*p++)
3339 { 3339 {
3340 case 'h': 3340 case 'h':
3341 lf->lfHeight = - points_to_pixels(p, &p, TRUE, (int)printer_dc); 3341 lf->lfHeight = - points_to_pixels(p, &p, TRUE, (long_i)printer_dc);
3342 break; 3342 break;
3343 case 'w': 3343 case 'w':
3344 lf->lfWidth = points_to_pixels(p, &p, FALSE, (int)printer_dc); 3344 lf->lfWidth = points_to_pixels(p, &p, FALSE, (long_i)printer_dc);
3345 break; 3345 break;
3346 case 'b': 3346 case 'b':
3347 #ifndef MSWIN16_FASTTEXT 3347 #ifndef MSWIN16_FASTTEXT
3348 lf->lfWeight = FW_BOLD; 3348 lf->lfWeight = FW_BOLD;
3349 #endif 3349 #endif