Ignore:
Timestamp:
Feb 22, 2012, 8:50:40 PM (13 years ago)
Author:
dmik
Message:

jdk: Fix a whole bunch of warnings and a few build errors.

GCC is more strict than MSVC.

Location:
trunk/openjdk/jdk/src/windows
Files:
40 edited

Legend:

Unmodified
Added
Removed
  • trunk/openjdk/jdk/src/windows/bin/java_md.c

    r294 r333  
    403403        && type == REG_SZ
    404404        && (size < (unsigned int)bufsize)) {
    405         if (RegQueryValueEx(key, name, 0, 0, buf, &size) == 0) {
     405        if (RegQueryValueEx(key, name, 0, 0, (LPBYTE)buf, &size) == 0) {
    406406            return JNI_TRUE;
    407407        }
     
    693693        JLI_MemFree(best);
    694694        len = MAXNAMELEN;
    695         if (RegQueryValueEx(ver_key, "JavaHome", NULL, NULL, (LPBYTE)name, &len)
     695        if (RegQueryValueEx(ver_key, "JavaHome", NULL, NULL, (LPBYTE)name,
     696                            (LPDWORD)&len)
    696697          != ERROR_SUCCESS) {
    697698            if (ver_key != NULL)
     
    975976        char    *p;
    976977        char    *np;
    977         char    *ocl;
     978        const char *ocl;
    978979        char    *ccl;
    979980        char    *unquoted;
     
    11911192    if (thread_handle) {
    11921193      WaitForSingleObject(thread_handle, INFINITE);
    1193       GetExitCodeThread(thread_handle, &rslt);
     1194      GetExitCodeThread(thread_handle, (LPDWORD)&rslt);
    11941195      CloseHandle(thread_handle);
    11951196    } else {
  • trunk/openjdk/jdk/src/windows/instrument/FileSystemSupport_md.c

    r278 r333  
    2727#include <string.h>
    2828#include <malloc.h>
     29
     30#ifdef __EMX__
     31#include <strings.h> // strcasecmp
     32#endif
    2933
    3034#include "FileSystemSupport_md.h"
  • trunk/openjdk/jdk/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp

    r278 r333  
    795795    DSCBUFFERDESC dscbdesc;
    796796#endif
    797     HRESULT res;
     797    HRESULT res = 0;
    798798    WAVEFORMATEXTENSIBLE format;
    799799    void* buffer;
     
    10761076                    DWORD* playCursor, DWORD* writeCursor,
    10771077                    int* bufferSize, BOOL fromPlayCursor) {
    1078     int available;
     1078    int available = 0;
    10791079    int newReadPos;
    10801080
  • trunk/openjdk/jdk/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_Util.c

    r278 r333  
    9494    SysExQueue* sysex;
    9595    int i;
    96     UBYTE* dataPtr;
     96    char* dataPtr;
    9797    int structSize = sizeof(SysExQueue) + ((count - 1) * sizeof(MIDIHDR));
    9898
     
    116116
    117117    // set up headers
    118     dataPtr = preAllocatedMem;
     118    dataPtr = (char*)preAllocatedMem;
    119119    for (i=0; i<count; i++) {
    120120        sysex->header[i].lpData = dataPtr;
  • trunk/openjdk/jdk/src/windows/native/java/net/NetworkInterface.c

    r278 r333  
    332332         */
    333333        strcpy(curr->name, dev_name);
    334         strncpy(curr->displayName, ifrowP->bDescr, ifrowP->dwDescrLen);
     334        strncpy(curr->displayName, (char*)ifrowP->bDescr, ifrowP->dwDescrLen);
    335335        curr->displayName[ifrowP->dwDescrLen] = '\0';
    336336        curr->dwIndex = ifrowP->dwIndex;
  • trunk/openjdk/jdk/src/windows/native/java/net/SocketOutputStream.c

    r278 r333  
    3131#include <malloc.h>
    3232#include <sys/types.h>
    33 
    34 #ifdef __EMX__
    35 #define min(a, b) ((a) < (b) ? (a) : (b))
    36 #endif
    3733
    3834#include "java_net_SocketOutputStream.h"
  • trunk/openjdk/jdk/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c

    r278 r333  
    430430    jobject fd1Obj = (*env)->GetObjectField(env, this, pdsi_fd1ID);
    431431
    432     int fd, fd1, family;
     432    int fd, fd1 = -1, family;
    433433    int ipv6_supported = ipv6_available();
    434434
     
    935935    jint packetBufferOffset, packetBufferLen;
    936936
    937     int fd, fd1, fduse, nsockets=0, errorCode;
     937    int fd = -1, fd1 = -1, fduse, nsockets=0, errorCode;
    938938    int port;
    939939    jbyteArray data;
     
    12101210     * must be called prior to receive() so that fduse can be set.
    12111211     */
    1212     int fd, fd1, fduse, errorCode;
     1212    int fd = -1, fd1 = -1, fduse, errorCode;
    12131213    jbyteArray data;
    12141214
  • trunk/openjdk/jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c

    r278 r333  
    196196    /* family and localport are int fields of iaObj */
    197197    int family;
    198     jint fd, fd1=-1;
     198    jint fd = -1, fd1 = -1;
    199199    jint len;
    200200    int  ipv6_supported = ipv6_available();
     
    269269        }
    270270    } else {
    271         int optval;
     271        u_long optval;
    272272        int optlen = sizeof(optval);
    273273
     
    405405    jobject fdObj, fd1Obj;
    406406    /* fd is an int field on fdObj */
    407     int fd, fd1, len;
     407    int fd = -1, fd1 = -1, len;
    408408    int ipv6_supported = ipv6_available();
    409409
     
    524524    jobject address;
    525525    /* fdObj's int fd field */
    526     int fd, fd1;
     526    int fd = -1, fd1;
    527527    SOCKETADDRESS addr; int addrlen;
    528528
     
    790790Java_java_net_TwoStacksPlainSocketImpl_socketAvailable(JNIEnv *env, jobject this) {
    791791
    792     jint available = -1;
     792    u_long available = -1;
    793793    jint res;
    794794    jobject fdObj = (*env)->GetObjectField(env, this, psi_fdID);
     
    10231023    int level, optname, optlen;
    10241024    union {
    1025         int i;
     1025        u_long i;
    10261026        struct linger ling;
    10271027    } optval;
  • trunk/openjdk/jdk/src/windows/native/java/net/net_util_md.c

    r278 r333  
    590590    if (family == AF_INET) {
    591591        struct sockaddr_in *him = (struct sockaddr_in *)addr;
    592         printf ("AF_INET: port %d: %x\n", ntohs(him->sin_port),
    593                                           ntohl(him->sin_addr.s_addr));
     592        printf ("AF_INET: port %d: %lx\n", ntohs(him->sin_port),
     593                                            ntohl(him->sin_addr.s_addr));
    594594    } else {
    595595        int i;
     
    597597        printf ("AF_INET6 ");
    598598        printf ("port %d ", ntohs (a->sin6_port));
    599         printf ("flow %d ", a->sin6_flowinfo);
     599        printf ("flow %ld ", a->sin6_flowinfo);
    600600        printf ("addr ");
    601601        for (i=0; i<7; i++) {
     
    603603        }
    604604        printf ("%04x", ntohs(in->s6_words[7]));
    605         printf (" scope %d\n", a->sin6_scope_id);
     605        printf (" scope %ld\n", a->sin6_scope_id);
    606606    }
    607607}
  • trunk/openjdk/jdk/src/windows/native/java/net/net_util_md.h

    r278 r333  
    342342extern jint NET_Wait(JNIEnv *env, jint fd, jint flags, jint timeout);
    343343extern int NET_Socket (int domain, int type, int protocol);
     344extern void NET_ThrowSocketException(JNIEnv *env, char* msg);
    344345extern void NET_ThrowByNameWithLastError(JNIEnv *env, const char *name,
    345346                                         const char *defaultDetail);
  • trunk/openjdk/jdk/src/windows/native/sun/java2d/j2d_md.h

    r278 r333  
    2727#define j2d_md_h_Included
    2828
     29#ifdef _MSC_VER
    2930#ifndef DEBUG
    3031#pragma optimize("t", on)
     32#endif
    3133#endif
    3234
  • trunk/openjdk/jdk/src/windows/native/sun/java2d/opengl/WGLGraphicsConfig.c

    r278 r333  
    202202    int pixfmts[32];
    203203    int chosenPixFmt = 0;
    204     int nfmts, i;
     204    UINT nfmts, i;
    205205
    206206    // this is the initial minimum value for the combined depth+stencil size
  • trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/GDIRenderer.cpp

    r278 r333  
    321321    }
    322322
    323     long sx, sy, ex, ey;
     323    jint sx, sy, ex, ey;
    324324    if (angleExtent >= 360 || angleExtent <= -360) {
    325325        sx = ex = x + w;
     
    594594        return;
    595595    }
    596     long sx, sy, ex, ey;
    597     int angleEnd;
     596    jint sx, sy, ex, ey;
     597    jint angleEnd;
    598598    if (angleExtent < 0) {
    599599        angleEnd = angleStart;
  • trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/Win32OffScreenSurfaceData.cpp

    r278 r333  
    467467    if (wsdo->lockFlags & SD_LOCK_LUT) {
    468468        pRasInfo->lutBase =
    469             (long *) wsdo->device->GetSystemPaletteEntries();
     469            (jint *) wsdo->device->GetSystemPaletteEntries();
    470470        pRasInfo->lutSize = 256;
    471471    } else {
  • trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/Win32SurfaceData.cpp

    r278 r333  
    940940    if (wsdo->lockFlags & SD_LOCK_LUT) {
    941941        pRasInfo->lutBase =
    942             (long *) wsdo->device->GetSystemPaletteEntries();
     942            (jint *) wsdo->device->GetSystemPaletteEntries();
    943943        pRasInfo->lutSize = 256;
    944944    } else {
  • trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/ddrawObject.cpp

    r278 r333  
    439439
    440440    DXSurface *dxSurface;
    441     DWORD dwFlags, ddsCaps;
     441    DWORD dwFlags, ddsCaps = 0;
    442442
    443443    // Create the offscreen surface
  • trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/ddrawUtils.cpp

    r278 r333  
    18001800        break;
    18011801    default:
    1802         sprintf(buffer, "DirectX Error Unknown 0x%x", errNum);
    1803         break;
    1804     }
    1805 
    1806 }
     1802        sprintf(buffer, "DirectX Error Unknown 0x%lx", errNum);
     1803        break;
     1804    }
     1805
     1806}
  • trunk/openjdk/jdk/src/windows/native/sun/management/FileSystemImpl.c

    r278 r333  
    209209static ACL* getFileDACL(JNIEnv* env, SECURITY_DESCRIPTOR* sd) {
    210210    ACL *acl;
    211     int defaulted, present;
     211    BOOL defaulted, present;
    212212
    213213    if (!(*GetSecurityDescriptorDacl_func)(sd, &present, &acl, &defaulted)) {
  • trunk/openjdk/jdk/src/windows/native/sun/net/dns/ResolverConfigurationImpl.c

    r278 r333  
    3131#include <time.h>
    3232#include <assert.h>
     33
     34#ifdef __WIN32OS2__
     35#include <string.h>
     36#endif
    3337
    3438#include "jni_util.h"
  • trunk/openjdk/jdk/src/windows/native/sun/net/spi/DefaultProxySelector.c

    r278 r333  
    2525
    2626#include <windows.h>
     27
     28#ifdef __WIN32OS2__
     29#include <string.h>
     30#endif
     31
    2732#include "jni.h"
    2833#include "jni_util.h"
  • trunk/openjdk/jdk/src/windows/native/sun/net/www/protocol/http/NTLMAuthSequence.c

    r278 r333  
    6666{
    6767    OSVERSIONINFO   version;
    68     UCHAR libName[MAX_PATH];
     68    char libName[MAX_PATH];
    6969
    7070    ntlm_ctxHandleID = (*env)->GetFieldID(env, clazz, "ctxHandle", "J");
     
    196196    CtxtHandle      *newContext;
    197197    TimeStamp            ltime;
    198     jbyteArray       result;
     198    jbyteArray       result = 0;
    199199
    200200
  • trunk/openjdk/jdk/src/windows/native/sun/nio/ch/WindowsSelectorImpl.c

    r309 r333  
    195195{
    196196    char bytes[WAKEUP_SOCKET_BUF_SIZE];
    197     long bytesToRead;
     197    u_long bytesToRead;
    198198
    199199    /* Drain socket */
  • trunk/openjdk/jdk/src/windows/native/sun/security/mscapi/security.cpp

    r278 r333  
    641641    HCRYPTKEY hKeyPair;
    642642    DWORD dwFlags = (keySize << 16) | CRYPT_EXPORTABLE;
    643     jobject keypair;
     643    jobject keypair = NULL;
    644644    const char* pszKeyContainerName = NULL; // UUID
    645645
     
    738738        } else {
    739739            char buffer[64];
    740             if (sprintf(buffer, "%lu", dwAlgId)) {
     740            if (sprintf(buffer, "%u", dwAlgId)) {
    741741                return env->NewStringUTF(buffer);
    742742            }
     
    14011401    jbyteArray blob = NULL;
    14021402    DWORD dwBlobLen;
    1403     BYTE* pbKeyBlob;
     1403    BYTE* pbKeyBlob = NULL;
    14041404
    14051405    __try
  • trunk/openjdk/jdk/src/windows/native/sun/security/pkcs11/j2secmod_md.h

    r278 r333  
    2626#include <windows.h>
    2727
     28#ifdef __EMX__
     29#define DECLSPEC_DLLIMPORT
     30#else
     31#define DECLSPEC_DLLIMPORT __declspec(dllimport)
     32#endif
     33
    2834// in nss.h:
    2935// extern PRBool NSS_VersionCheck(const char *importedVersion);
    3036// extern SECStatus NSS_Init(const char *configdir);
    31 typedef int __declspec(dllimport) (*FPTR_VersionCheck)(const char *importedVersion);
    32 typedef int __declspec(dllimport) (*FPTR_Init)(const char *configdir);
     37typedef int DECLSPEC_DLLIMPORT (*FPTR_VersionCheck)(const char *importedVersion);
     38typedef int DECLSPEC_DLLIMPORT (*FPTR_Init)(const char *configdir);
    3339
    3440// in secmod.h
     
    3844//extern SECMODModuleList *SECMOD_GetDBModuleList(void);
    3945
    40 typedef void __declspec(dllimport) *(*FPTR_LoadModule)(char *moduleSpec, void *parent, int recurse);
    41 typedef char __declspec(dllimport) **(*FPTR_GetModuleSpecList)(void *module);
    42 typedef void __declspec(dllimport) *(*FPTR_GetDBModuleList)(void);
     46typedef void DECLSPEC_DLLIMPORT *(*FPTR_LoadModule)(char *moduleSpec, void *parent, int recurse);
     47typedef char DECLSPEC_DLLIMPORT **(*FPTR_GetModuleSpecList)(void *module);
     48typedef void DECLSPEC_DLLIMPORT *(*FPTR_GetDBModuleList)(void);
  • trunk/openjdk/jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.h

    r2 r333  
    5959#include <windows.h>
    6060
     61#ifdef __EMX__
     62#define DECLSPEC_DLLIMPORT
     63#else
     64#define DECLSPEC_DLLIMPORT __declspec(dllimport)
     65#endif
     66
    6167/* statement according to PKCS11 docu */
    6268#pragma pack(push, cryptoki, 1)
     
    6470/* definitions according to PKCS#11 docu for Win32 environment */
    6571#define CK_PTR *
    66 #define CK_DEFINE_FUNCTION(returnType, name) returnType __declspec(dllexport) name
    67 #define CK_DECLARE_FUNCTION(returnType, name) returnType __declspec(dllimport) name
    68 #define CK_DECLARE_FUNCTION_POINTER(returnType, name) returnType __declspec(dllimport) (* name)
     72#define CK_DEFINE_FUNCTION(returnType, name) returnType DECLSPEC_DLLIMPORT name
     73#define CK_DECLARE_FUNCTION(returnType, name) returnType DECLSPEC_DLLIMPORT name
     74#define CK_DECLARE_FUNCTION_POINTER(returnType, name) returnType DECLSPEC_DLLIMPORT (* name)
    6975#define CK_CALLBACK_FUNCTION(returnType, name) returnType (* name)
    7076#ifndef NULL_PTR
  • trunk/openjdk/jdk/src/windows/native/sun/windows/GDIHashtable.cpp

    r278 r333  
    135135                                                               UINT nSecondThreshold,
    136136                                                               UINT nDestroyPeriod) :
     137  m_nCounter(0),
    137138  m_nFirstThreshold(nFirstThreshold),
    138139  m_nSecondThreshold(nSecondThreshold),
    139140  m_nDestroyPeriod(nDestroyPeriod),
    140   m_nCounter(0),
    141141  m_bBatchingEnabled(TRUE) {
    142142    load_rsrc32_procs();
  • trunk/openjdk/jdk/src/windows/native/sun/windows/ShellFolder2.cpp

    r278 r333  
    231231    if (FAILED(hr)) {
    232232        char c[64];
    233         sprintf(c, "Could not initialize COM: HRESULT=0x%08X", hr);
     233        sprintf(c, "Could not initialize COM: HRESULT=0x%08lX", hr);
    234234        JNU_ThrowInternalError(env, c);
    235235    }
     
    625625    STRRET strret;
    626626    OLECHAR olePath[MAX_PATH]; // wide-char version of path name
    627     LPWSTR wstr;
     627    LPWSTR wstr = NULL;
    628628
    629629    IShellFolder* pParent = (IShellFolder*)parentIShellFolder;
     
    959959            // Extract the color bitmap
    960960            int nBits = iconSize * iconSize;
    961             long colorBits[1024];
     961            jint colorBits[1024];
    962962            GetDIBits(dc, iconInfo.hbmColor, 0, iconSize, colorBits, &bmi, DIB_RGB_COLORS);
    963963            // XP supports alpha in some icons, and depending on device.
     
    10111011    HBITMAP hBitmap = NULL;
    10121012    BITMAP bm;
    1013     HINSTANCE libComCtl32;
     1013    HINSTANCE libComCtl32 = NULL;
    10141014    HINSTANCE libShell32;
    10151015
     
    10521052    int numPixels = bm.bmWidth * bm.bmHeight;
    10531053    //long colorBits[192 * 16];
    1054     long *colorBits = (long*)safe_Malloc(numPixels * sizeof(long));
     1054    jint *colorBits = (jint*)safe_Malloc(numPixels * sizeof(jint));
    10551055    if (GetDIBits(dc, hBitmap, 0, bm.bmHeight, colorBits, &bmi, DIB_RGB_COLORS) == 0) {
    10561056        return NULL;
  • trunk/openjdk/jdk/src/windows/native/sun/windows/UnicowsLoader.cpp

    r278 r333  
    4646HMODULE UnicowsLoader::hmodUnicows = NULL;
    4747
     48extern "C"
     49{
    4850// MSLU loader entry point, which is called when the module
    4951// is initialized.
    50 extern "C" HMODULE (__stdcall *_PfnLoadUnicows)(void) =
     52HMODULE (__stdcall *_PfnLoadUnicows)(void) =
    5153        &UnicowsLoader::LoadUnicows;
    5254
    5355// Overriede APIs that are not supported by MSLU.
    54 extern "C" FARPROC Unicows_GetPrinterW =
     56FARPROC Unicows_GetPrinterW =
    5557        (FARPROC)&UnicowsLoader::GetPrinterWImpl;
    56 extern "C" FARPROC Unicows_EnumPrintersW =
     58FARPROC Unicows_EnumPrintersW =
    5759        (FARPROC)&UnicowsLoader::EnumPrintersWImpl;
     60}
    5861
    5962HMODULE __stdcall UnicowsLoader::LoadUnicows(void)
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Component.cpp

    r309 r333  
    52505250    jint wheelAmt = 0;
    52515251    jint id = (env)->GetIntField(mouseEvent, AwtAWTEvent::idID);
    5252     UINT message;
     5252    UINT message = 0;
    52535253    switch (id) {
    52545254      case java_awt_event_MouseEvent_MOUSE_PRESSED: {
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp

    r278 r333  
    367367
    368368    BOOL fontSmoothing = FALSE, settingsChanged;
    369     UINT fontSmoothingType=0, fontSmoothingContrast=0, subPixelOrder;
     369    UINT fontSmoothingType=0, fontSmoothingContrast=0, subPixelOrder=0;
    370370
    371371    if (firstTime) {
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DnDDS.cpp

    r278 r333  
    11781178    m_parent = parent;
    11791179
    1180     m_buffer = (signed char *)safe_Calloc(sizeof(signed char), m_blen = blen);
     1180    m_buffer = (jbyte *)safe_Calloc(sizeof(jbyte), m_blen = blen);
    11811181
    11821182    env->GetByteArrayRegion(buffer, 0, blen, m_buffer);
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DnDDS.h

    r278 r333  
    207207                AwtDragSource*   m_parent;
    208208
    209                 signed   char*   m_buffer;
     209                jbyte*           m_buffer;
    210210                unsigned int     m_off;
    211211                unsigned int     m_blen;
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Font.cpp

    r278 r333  
    891891
    892892            for (; len; len--) {
    893                 result += widths[*pStr++];
     893                result += widths[(unsigned char)*pStr++];
    894894            }
    895895        } catch (...) {
     
    11991199
    12001200LONG AwtFontCache::IncRefCount(Item* item){
    1201     LONG    newVal;
     1201    LONG    newVal = 0;
    12021202
    12031203    if(NULL != item){
     
    12081208
    12091209LONG AwtFontCache::DecRefCount(Item* item){
    1210     LONG    newVal;
     1210    LONG    newVal = 0;
    12111211
    12121212    if(NULL != item){
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Frame.cpp

    r278 r333  
    147147    PDATA pData;
    148148    HWND hwndParent = NULL;
    149     AwtFrame* frame;
     149    AwtFrame* frame = NULL;
    150150    jclass cls = NULL;
    151151    jclass inputMethodWindowCls = NULL;
     
    872872MsgRouting AwtFrame::WmActivate(UINT nState, BOOL fMinimized, HWND opposite)
    873873{
    874     jint type;
     874    jint type = 0;
    875875    BOOL doActivateFrame = TRUE;
    876876
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Label.cpp

    r278 r333  
    125125        if (env->EnsureLocalCapacity(3) < 0)
    126126            return;
    127         long x,y;
     127        long x = 0, y;
    128128        SIZE size;
    129129
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Menu.h

    r278 r333  
    8080    /*for multifont menu */
    8181    BOOL IsTopMenu();
    82     virtual AwtMenuItem* GetItem(jobject target, long index);
     82    virtual AwtMenuItem* GetItem(jobject target, jint index);
    8383
    8484    virtual int CountItem(jobject target);
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_PrintJob.cpp

    r278 r333  
    915915    HGLOBAL hDevNames = AwtPrintControl::getPrintHDName(env, self);
    916916    if (hDevNames != NULL) {
    917         DWORD dmFields;
     917        DWORD dmFields = 0;
    918918        DEVNAMES *devnames = (DEVNAMES *)::GlobalLock(hDevNames);
    919919
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_TextArea.cpp

    r278 r333  
    114114        {
    115115            /* Adjust style for scrollbar visibility and word wrap  */
    116           DWORD scroll_style;
     116          DWORD scroll_style = 0;
    117117          jint scrollbarVisibility =
    118118              env->GetIntField(target, AwtTextArea::scrollbarVisibilityID);
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_TextComponent.cpp

    r278 r333  
    775775    JNI_CHECK_PEER_RETURN_NULL(self);
    776776    AwtComponent* c = (AwtComponent*)pData;
    777 /*
    778     int line = 0;
    779     int lineIndex = 0;
    780     while (lineIndex < i) {
    781         lineIndex = c->SendMessage(EM_LINEINDEX, 1 + line++);
    782     }
    783     line--;     // line is now the line which contains our character at position 'i'
    784     int offsetIndex = i - lineIndex;    // offsetIndex is now distance in on the line
    785 * /
     777
     778//    int line = 0;
     779//    int lineIndex = 0;
     780//    while (lineIndex < i) {
     781//        lineIndex = c->SendMessage(EM_LINEINDEX, 1 + line++);
     782//    }
     783//    line--;     // line is now the line which contains our character at position 'i'
     784//    int offsetIndex = i - lineIndex;    // offsetIndex is now distance in on the line
     785
    786786    POINT p;
    787787
     
    793793    jint charHeight;
    794794
    795 /*
    796     HFONT font = c->SendMessage(WM_GETFONT);
    797     if (GetCharWidth32(c->hdc, i, i, &charWidth) != 0) {        // [[[FIXME]]] need to get hDC!
    798 
    799         JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
    800         jobject rect = JNU_NewObjectByName(env, "java/awt/Rectangle", "(IIII)V",
    801                                            (jint) p.x, (jint) p.y, charWidth, charHeight);
    802 
    803         return rect;
    804     }
    805 * /
     795//    HFONT font = c->SendMessage(WM_GETFONT);
     796//    if (GetCharWidth32(c->hdc, i, i, &charWidth) != 0) {        // [[[FIXME]]] need to get hDC!
     797//
     798//        JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
     799//        jobject rect = JNU_NewObjectByName(env, "java/awt/Rectangle", "(IIII)V",
     800//                                           (jint) p.x, (jint) p.y, charWidth, charHeight);
     801//
     802//        return rect;
     803//    }
     804
    806805    return (jobject) 0;
    807806
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp

    r278 r333  
    412412#endif
    413413
    414         //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
     414        ///////////////////////////////////////////////////////////////////////////
    415415        // Bugs 4032109, 4047966, and 4071991 to fix AWT
    416416        //      crash in 16 color display mode.  16 color mode is supported.  Less
     
    583583
    584584    jobject gcomponent = env->NewGlobalRef((jobject)component);
    585     jobject gparent;
     585    jobject gparent = 0;
    586586    if (isParentALocalReference) gparent = env->NewGlobalRef((jobject)parent);
    587587    ComponentCreatePacket ccp = { gcomponent,
Note: See TracChangeset for help on using the changeset viewer.