Mercurial > vim
comparison src/gui_mac.c @ 9649:fd9727ae3c49 v7.4.2101
commit https://github.com/vim/vim/commit/2932359000b2f918d5fade79ea4d124d5943cd07
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 24 22:04:11 2016 +0200
patch 7.4.2101
Problem: Looping over windows, buffers and tab pages is inconsistant.
Solution: Use FOR_ALL_ macros everywhere. (Yegappan Lakshmanan)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 24 Jul 2016 22:15:07 +0200 |
parents | 0c7f47088e55 |
children | 989d44d35a66 |
comparison
equal
deleted
inserted
replaced
9648:227649fd4301 | 9649:fd9727ae3c49 |
---|---|
631 | 631 |
632 error = HandleUnusedParms(theAEvent); | 632 error = HandleUnusedParms(theAEvent); |
633 if (error) | 633 if (error) |
634 return error; | 634 return error; |
635 | 635 |
636 for (buf = firstbuf; buf != NULL; buf = buf->b_next) | 636 FOR_ALL_BUFFERS(buf) |
637 if (buf->b_ml.ml_mfp != NULL | 637 if (buf->b_ml.ml_mfp != NULL |
638 && SearchData.theFile.parID == buf->b_FSSpec.parID | 638 && SearchData.theFile.parID == buf->b_FSSpec.parID |
639 && SearchData.theFile.name[0] == buf->b_FSSpec.name[0] | 639 && SearchData.theFile.name[0] == buf->b_FSSpec.name[0] |
640 && STRNCMP(SearchData.theFile.name, buf->b_FSSpec.name, buf->b_FSSpec.name[0] + 1) == 0) | 640 && STRNCMP(SearchData.theFile.name, buf->b_FSSpec.name, buf->b_FSSpec.name[0] + 1) == 0) |
641 { | 641 { |
723 | 723 |
724 /* AEPutDesc */ | 724 /* AEPutDesc */ |
725 #endif | 725 #endif |
726 | 726 |
727 numFiles = 0; | 727 numFiles = 0; |
728 for (buf = firstbuf; buf != NULL; buf = buf->b_next) | 728 FOR_ALL_BUFFERS(buf) |
729 if (buf->b_ml.ml_mfp != NULL) | 729 if (buf->b_ml.ml_mfp != NULL) |
730 { | 730 { |
731 /* Add this file to the list */ | 731 /* Add this file to the list */ |
732 theFile.theFile = buf->b_FSSpec; | 732 theFile.theFile = buf->b_FSSpec; |
733 theFile.theDate = buf->b_mtime; | 733 theFile.theDate = buf->b_mtime; |
805 error = AEGetParamPtr(theAEvent, keyDirectObject, typeChar, &typeCode, (Ptr) &GetTextData, sizeof(GetTextData), &actualSize); | 805 error = AEGetParamPtr(theAEvent, keyDirectObject, typeChar, &typeCode, (Ptr) &GetTextData, sizeof(GetTextData), &actualSize); |
806 | 806 |
807 if (error) | 807 if (error) |
808 return error; | 808 return error; |
809 | 809 |
810 for (buf = firstbuf; buf != NULL; buf = buf->b_next) | 810 FOR_ALL_BUFFERS(buf) |
811 if (buf->b_ml.ml_mfp != NULL) | 811 if (buf->b_ml.ml_mfp != NULL) |
812 if (GetTextData.theFile.parID == buf->b_FSSpec.parID) | 812 if (GetTextData.theFile.parID == buf->b_FSSpec.parID) |
813 { | 813 { |
814 foundFile = true; | 814 foundFile = true; |
815 break; | 815 break; |
6420 getTabCount(void) | 6420 getTabCount(void) |
6421 { | 6421 { |
6422 tabpage_T *tp; | 6422 tabpage_T *tp; |
6423 int numTabs = 0; | 6423 int numTabs = 0; |
6424 | 6424 |
6425 for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) | 6425 FOR_ALL_TABPAGES(tp) |
6426 ++numTabs; | 6426 ++numTabs; |
6427 return numTabs; | 6427 return numTabs; |
6428 } | 6428 } |
6429 | 6429 |
6430 // data browser item display callback | 6430 // data browser item display callback |