none
VS2008中编辑.格式化选定内容(Ctrl + K,Ctrl + F)的使用问题 RRS feed

  • 问题

  • 下面前一种是VS2008的结果,后一种是在VC6.0格式化的结果,明显VS2008的缩进判断有问题,不知道是不是哪里有设置可以改进这种缩进问题?

            switch(event.type) {
            case SDL_KEYDOWN:
                switch(event.key.keysym.sym) {
            case SDLK_LEFT:
                incr = -10.0;
                goto do_seek;
            case SDLK_RIGHT:
                incr = 10.0;
                goto do_seek;
            case SDLK_UP:
                incr = 60.0;
                goto do_seek;
            case SDLK_DOWN:
                incr = -60.0;
                goto do_seek;
    do_seek:
                if(global_video_state) {
                    pos = get_master_clock(global_video_state);
                    pos += incr;
                    stream_seek(global_video_state, (int64_t)(pos * AV_TIME_BASE), incr);
                }
                break;
            default:
                break;
                }
                break;
            case FF_QUIT_EVENT:
            case SDL_QUIT:
                is->quit = 1;
                SDL_Quit();
                exit(0);
                break;
            case FF_ALLOC_EVENT:
                alloc_picture(event.user.data1);
                break;
            case FF_REFRESH_EVENT:
                video_refresh_timer(event.user.data1);
                break;
            default:
                break;
            }

            switch(event.type) {
            case SDL_KEYDOWN:
                switch(event.key.keysym.sym) {
                case SDLK_nbsp;               incr = -10.0;
                    goto do_seek;
                case SDLK_RIGHT:
                    incr = 10.0;
                    goto do_seek;
                case SDLK_UP:
                    incr = 60.0;
                    goto do_seek;
                case SDLK_DOWN:
                    incr = -60.0;
                    goto do_seek;
    do_seek:
                    if(global_video_state) {
                        pos = get_master_clock(global_video_state);
                        pos += incr;
                        stream_seek(global_video_state, (int64_t)(pos * AV_TIME_BASE), incr);
                    }
                    break;
                default:
                    break;
                }
                break;
                case FF_QUIT_EVENT:
                case SDL_QUIT:
                    is->quit = 1;
                    SDL_Quit();
                    exit(0);
                    break;
                case FF_ALLOC_EVENT:
                    alloc_picture(event.user.data1);
                    break;
                case FF_REFRESH_EVENT:
                    video_refresh_timer(event.user.data1);
                    break;
                default:
                    break;
            }

    2012年8月17日 7:50

答案

全部回复